Struct mun_runtime::StructRef [−][src]
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]
&self,
field_name: &str
) -> Result<T, String> where
T: 's,
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]
&mut self,
field_name: &str,
value: T
) -> Result<T, String> where
T: 's,
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]
&mut self,
field_name: &str,
value: T
) -> Result<(), String>
Sets the value of the field corresponding to the specified field_name
.
Trait Implementations
impl<'r> ArgumentReflection for StructRef<'r>
[src]
fn type_guid(&self, runtime: &Runtime) -> Guid
[src]
fn type_name(&self, runtime: &Runtime) -> &str
[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
fn marshal_from<'r>(value: Self::MunType, runtime: &'r Runtime) -> Self where
Self: 's,
'r: 's,
[src]
Self: 's,
'r: 's,
fn marshal_into<'r>(self) -> Self::MunType
[src]
fn marshal_from_ptr<'r>(
ptr: NonNull<Self::MunType>,
runtime: &'r Runtime,
type_info: Option<&TypeInfo>
) -> StructRef<'s> where
Self: 's,
'r: 's,
[src]
ptr: NonNull<Self::MunType>,
runtime: &'r Runtime,
type_info: Option<&TypeInfo>
) -> StructRef<'s> where
Self: 's,
'r: 's,
fn marshal_to_ptr(
value: Self,
ptr: NonNull<Self::MunType>,
type_info: Option<&TypeInfo>
)
[src]
value: Self,
ptr: NonNull<Self::MunType>,
type_info: Option<&TypeInfo>
)
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,