Struct mun_runtime::StructRef[][src]

pub struct StructRef<'s> { /* fields omitted */ }

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

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

pub fn into_raw(self) -> RawStruct[src]

Consumes the StructRef, returning a raw Mun struct.

pub fn root(self, runtime: Rc<RefCell<Runtime>>) -> RootedStruct[src]

Roots the StructRef.

pub fn type_info(&self) -> &TypeInfo[src]

Returns the type information of the struct.

pub fn get<T: ReturnTypeReflection + Marshal<'s>>(
    &self,
    field_name: &str
) -> Result<T, String> where
    T: 's, 
[src]

Retrieves the value of the field corresponding to the specified field_name.

pub fn replace<T: ArgumentReflection + Marshal<'s>>(
    &mut self,
    field_name: &str,
    value: T
) -> Result<T, String> where
    T: 's, 
[src]

Replaces the value of the field corresponding to the specified field_name and returns the old value.

pub fn set<T: ArgumentReflection + Marshal<'s>>(
    &mut self,
    field_name: &str,
    value: T
) -> Result<(), String>
[src]

Sets the value of the field corresponding to the specified field_name.

Trait Implementations

impl<'r> ArgumentReflection for StructRef<'r>[src]

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

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

type MunType = RawStruct

The type used in the Mun ABI

impl<'r> ReturnTypeReflection for StructRef<'r>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,