Trait mun_runtime::Marshal[][src]

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: Option<&TypeInfo>
    ) -> Self
    where
        Self: 't,
        'r: 't
;
fn marshal_to_ptr(
        value: Self,
        ptr: NonNull<Self::MunType>,
        type_info: Option<&TypeInfo>
    ); }

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 ().

Associated Types

type MunType[src]

The type used in the Mun ABI

Loading content...

Required methods

fn marshal_from<'r>(value: Self::MunType, runtime: &'r Runtime) -> Self where
    Self: 't,
    'r: 't, 
[src]

Marshals from a value (i.e. Mun -> Rust).

fn marshal_into(self) -> Self::MunType[src]

Marshals itself into a Marshalled value (i.e. Rust -> Mun).

fn marshal_from_ptr<'r>(
    ptr: NonNull<Self::MunType>,
    runtime: &'r Runtime,
    type_info: Option<&TypeInfo>
) -> Self where
    Self: 't,
    'r: 't, 
[src]

Marshals the value at memory location ptr into a Marshalled value (i.e. Mun -> Rust).

fn marshal_to_ptr(
    value: Self,
    ptr: NonNull<Self::MunType>,
    type_info: Option<&TypeInfo>
)
[src]

Marshals value to memory location ptr (i.e. Rust -> Mun).

Loading content...

Implementations on Foreign Types

impl<'t> Marshal<'t> for i8[src]

type MunType = i8

impl<'t> Marshal<'t> for i16[src]

type MunType = i16

impl<'t> Marshal<'t> for i32[src]

type MunType = i32

impl<'t> Marshal<'t> for i64[src]

type MunType = i64

impl<'t> Marshal<'t> for i128[src]

type MunType = i128

impl<'t> Marshal<'t> for isize[src]

type MunType = isize

impl<'t> Marshal<'t> for u8[src]

type MunType = u8

impl<'t> Marshal<'t> for u16[src]

type MunType = u16

impl<'t> Marshal<'t> for u32[src]

type MunType = u32

impl<'t> Marshal<'t> for u64[src]

type MunType = u64

impl<'t> Marshal<'t> for u128[src]

type MunType = u128

impl<'t> Marshal<'t> for usize[src]

type MunType = usize

impl<'t> Marshal<'t> for f32[src]

type MunType = f32

impl<'t> Marshal<'t> for f64[src]

type MunType = f64

impl<'t> Marshal<'t> for bool[src]

type MunType = bool

impl<'t> Marshal<'t> for ()[src]

type MunType = ()

Loading content...

Implementors

impl<'s> Marshal<'s> for StructRef<'s>[src]

type MunType = RawStruct

Loading content...