pub trait Marshal<'t>: Sized {
type MunType;
// Required methods
fn marshal_from<'r>(value: Self::MunType, runtime: &'r Runtime) -> Self
where Self: 't,
'r: 't;
fn marshal_into(self) -> Self::MunType;
fn marshal_from_ptr<'r>(
ptr: NonNull<Self::MunType>,
runtime: &'r Runtime,
type_info: &Type,
) -> Self
where Self: 't,
'r: 't;
fn marshal_to_ptr(
value: Self,
ptr: NonNull<Self::MunType>,
type_info: &Type,
);
}Expand description
Used to do value-to-value conversions that require runtime type information while consuming the input value.
If no TypeInfo is provided, the type is ().
Required Associated Types§
Required Methods§
Sourcefn marshal_from<'r>(value: Self::MunType, runtime: &'r Runtime) -> Selfwhere
Self: 't,
'r: 't,
fn marshal_from<'r>(value: Self::MunType, runtime: &'r Runtime) -> Selfwhere
Self: 't,
'r: 't,
Marshals from a value (i.e. Mun -> Rust).
Sourcefn marshal_into(self) -> Self::MunType
fn marshal_into(self) -> Self::MunType
Marshals itself into a Marshalled value (i.e. Rust -> Mun).
Sourcefn marshal_from_ptr<'r>(
ptr: NonNull<Self::MunType>,
runtime: &'r Runtime,
type_info: &Type,
) -> Selfwhere
Self: 't,
'r: 't,
fn marshal_from_ptr<'r>(
ptr: NonNull<Self::MunType>,
runtime: &'r Runtime,
type_info: &Type,
) -> Selfwhere
Self: 't,
'r: 't,
Marshals the value at memory location ptr into a Marshalled value (i.e. Mun -> Rust).
Sourcefn marshal_to_ptr(value: Self, ptr: NonNull<Self::MunType>, type_info: &Type)
fn marshal_to_ptr(value: Self, ptr: NonNull<Self::MunType>, type_info: &Type)
Marshals value to memory location ptr (i.e. Rust -> Mun).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.