Struct mun_runtime::StructRef
source · pub struct StructRef<'s> { /* private fields */ }
Expand description
Type-agnostic wrapper for interoperability with a Mun struct. This is merely a reference to the Mun struct, that will be garbage collected unless it is rooted.
Implementations§
source§impl<'s> StructRef<'s>
impl<'s> StructRef<'s>
sourcepub fn root(self) -> RootedStruct
pub fn root(self) -> RootedStruct
Roots the StructRef
.
sourcepub fn get<T>(&self, field_name: &str) -> Result<T, String>where
T: 's + ReturnTypeReflection + Marshal<'s>,
pub fn get<T>(&self, field_name: &str) -> Result<T, String>where
T: 's + ReturnTypeReflection + Marshal<'s>,
Retrieves the value of the field corresponding to the specified field_name
.
Trait Implementations§
source§impl<'r> ArgumentReflection for StructRef<'r>
impl<'r> ArgumentReflection for StructRef<'r>
source§impl<'s> Marshal<'s> for StructRef<'s>
impl<'s> Marshal<'s> for StructRef<'s>
source§fn marshal_from<'r>(value: Self::MunType, runtime: &'r Runtime) -> Selfwhere
'r: 's,
fn marshal_from<'r>(value: Self::MunType, runtime: &'r Runtime) -> Selfwhere
'r: 's,
Marshals from a value (i.e. Mun -> Rust).
source§fn marshal_into<'r>(self) -> Self::MunType
fn marshal_into<'r>(self) -> Self::MunType
Marshals itself into a
Marshalled
value (i.e. Rust -> Mun).