pub struct StructInstance { /* private fields */ }Implementations§
Source§impl StructInstance
impl StructInstance
pub fn type_name(&self) -> &str
pub fn field<T: FromLustValue>(&self, field: &str) -> Result<T>
pub fn borrow_field(&self, field: &str) -> Result<ValueRef<'_>>
pub fn set_field<V: IntoTypedValue>(&self, field: &str, value: V) -> Result<()>
pub fn update_field<F, V>(&self, field: &str, update: F) -> Result<()>
pub fn as_value(&self) -> &Value
Source§impl StructInstance
impl StructInstance
pub fn to_handle(&self) -> StructHandle
pub fn into_handle(self) -> StructHandle
Trait Implementations§
Source§impl Clone for StructInstance
impl Clone for StructInstance
Source§fn clone(&self) -> StructInstance
fn clone(&self) -> StructInstance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<StructHandle> for StructInstance
impl From<StructHandle> for StructInstance
Source§fn from(handle: StructHandle) -> Self
fn from(handle: StructHandle) -> Self
Converts to this type from the input type.
Source§impl From<StructInstance> for StructHandle
impl From<StructInstance> for StructHandle
Source§fn from(instance: StructInstance) -> Self
fn from(instance: StructInstance) -> Self
Converts to this type from the input type.
Source§impl FromLustValue for StructInstance
impl FromLustValue for StructInstance
fn from_value(value: Value) -> Result<Self>
fn matches_lust_type(ty: &Type) -> bool
fn type_description() -> &'static str
Source§impl<'a> FromStructField<'a> for StructInstance
impl<'a> FromStructField<'a> for StructInstance
Source§impl IntoLustValue for StructInstance
impl IntoLustValue for StructInstance
fn into_value(self) -> Value
fn matches_lust_type(ty: &Type) -> bool
fn type_description() -> &'static str
Source§impl IntoTypedValue for StructInstance
impl IntoTypedValue for StructInstance
fn into_typed_value(self) -> TypedValue
Auto Trait Implementations§
impl Freeze for StructInstance
impl !RefUnwindSafe for StructInstance
impl !Send for StructInstance
impl !Sync for StructInstance
impl Unpin for StructInstance
impl UnsafeUnpin for StructInstance
impl !UnwindSafe for StructInstance
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