Trait mun_runtime::Marshal
source · pub trait Marshal<'t>: Sized {
type MunType;
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).