Comments (2)
So the constraint on DataTypeFunctions
you spotted in the linked issue does it, it's just that change hasn't been released yet.
The way this works is a little convoluted.
Implementing the TypedData
trait is what allows wrapping a struct. TypedData
already requires Send
. To implement TypedData
for T
you need to be able to construct a DataType
. To construct a DataType
you need to use DataTypeBuilder<T>
, and DataTypeBuilder<T>
has a bound on T
that it must implement DataTypeFunctions
.
The flags in the #[wrap]
macro expand to calling methods on DataTypeBuilder<T>
and there is an extra bound for T
for the frozen_shareable
method. This will error if you try to use the frozen_shareable
flag for a non-Sync
type.
from magnus.
Ah awesome! Thanks a lot.
from magnus.
Related Issues (20)
- Add Support for Passing an Array to Proc.Call HOT 1
- Discussion: Pin Ruby values to the stack HOT 5
- Feature Request: Add default type parameters to scan_args
- Sidekiq not handling signals? HOT 7
- `Vec<Vec<(String, usize)>>` panics with unsatisfied trait bounds HOT 3
- `AsRef`
- Deadlock when first creating rust-ext objects on threads HOT 5
- Integration with Rust futures?
- Question: Best approach to implementing a timestamp with nanosecond precision and timezone awareness HOT 3
- Question about a performance issue HOT 6
- Confused about how to pass a Ruby array to a Rust function HOT 1
- How well does the embed feature work? HOT 1
- Build is broken when trying to use Bytes feature HOT 2
- a possible solution for unlocking the GVL
- Instructions for Examples HOT 3
- MSRV Change HOT 1
- RHash.lookup for bool value HOT 5
- Automatic `frozen?` check HOT 2
- Exposing mutable wrapped class methods HOT 1
- Magnus overhead compared to rb-sys HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magnus.