pub trait CReprOf<T>: Sized + CDrop {
// Required method
fn c_repr_of(input: T) -> Result<Self, CReprOfError>;
}Expand description
Consuming conversion from an idiomatic Rust value to its
#[repr(C)] mirror.
Implementing CReprOf<U> for T states that T is a C-compatible layout
of the Rust value U and that a T can be built from a U. The resulting
T owns any heap memory it allocates, and that memory is reclaimed by the
corresponding CDrop implementation.
see Deriving the traits.
Required Methods§
Sourcefn c_repr_of(input: T) -> Result<Self, CReprOfError>
fn c_repr_of(input: T) -> Result<Self, CReprOfError>
Consume input and return its C-compatible representation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".