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).Auto Trait Implementations§
impl<'s> Freeze for StructRef<'s>
impl<'s> !RefUnwindSafe for StructRef<'s>
impl<'s> !Send for StructRef<'s>
impl<'s> !Sync for StructRef<'s>
impl<'s> Unpin for StructRef<'s>
impl<'s> !UnwindSafe for StructRef<'s>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more