[−][src]Module jlrs::traits
All traits used by this crate.
Most of these traits are intended for internal use only and you should never manually implement them for your own types nor call any of their trait methods directly.
The one major exception is the Frame
trait. This trait is implemented by the two frame
types that are provided, StaticFrame
and DynamicFrame
which are used to ensure the
garbage collector doesn't drop the data that's used from Rust. It provides the common
functionality these frame types offer.
Two of the traits in this module are available as custom derive traits, JuliaStruct
and
IntoJulia
, which can be used to map a struct between Julia and Rust. Deriving the first
will implement JuliaType
, JuliaTypecheck
, ValidLayout
, and Cast
, which will let you
safely access the raw contents of a value; IntoJulia
can be derived for bits types and lets
you create new instances of that type using Value::new
. While it's possible to manually
implement and annotate these mapping structs, you should use JlrsReflect.jl
which can
generate these structs for you. If you do want to do this manually, see the documentation of
JuliaStruct
for instructions.
Traits
Align | Trait implemented by the aligning structs, which ensure bits unions are properly aligned.
Used in combination with |
BitsUnion | Trait implemented by structs that can contain a bits union.
Used in combination with |
Cast | This trait is implemented by types that a |
Flag | Trait implemented by structs that can contain the flag of a bits union.
Used in combination with |
Frame | Functionality shared by |
IntoJulia | Trait implemented by types that can be converted to a Julia value in combination with
|
JuliaStruct | This trait can be derived in order to provide a mapping between a type in Julia and one in Rust. When this trait is derived, the following traits are implemented: |
JuliaType | Trait implemented by types that have an associated type in Julia. |
JuliaTypecheck | This trait is used in combination with |
TemporarySymbol | Trait implemented by types that can be converted to a temporary |
ValidLayout | Trait implemented as part of |