pub unsafe trait CType: Copy {
type RetType: From<Self> + TryInto<Self>;
// Required method
fn reify() -> Type<Self>;
}
Expand description
Types that we can automatically marshall to/from C.
In particular, for any type T
that implements CType
, we can
get a Type<T>
for describing that type.
This trait is unsafe to implement because if the libffi type
associated with a Rust type doesn’t match then we get
undefined behavior.