pub struct StructHandle { /* private fields */ }Implementations§
Source§impl StructHandle
impl StructHandle
pub fn from_value(value: Value) -> Result<Self>
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
pub fn to_instance(&self) -> StructInstance
pub fn into_instance(self) -> StructInstance
pub fn matches_type(&self, expected: &str) -> bool
pub fn ensure_type(&self, expected: &str) -> Result<()>
Trait Implementations§
Source§impl Clone for StructHandle
impl Clone for StructHandle
Source§fn clone(&self) -> StructHandle
fn clone(&self) -> StructHandle
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 StructHandle
impl FromLustValue for StructHandle
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 StructHandle
impl<'a> FromStructField<'a> for StructHandle
Source§impl IntoLustValue for StructHandle
impl IntoLustValue for StructHandle
fn into_value(self) -> Value
fn matches_lust_type(ty: &Type) -> bool
fn type_description() -> &'static str
Source§impl IntoTypedValue for StructHandle
impl IntoTypedValue for StructHandle
fn into_typed_value(self) -> TypedValue
Auto Trait Implementations§
impl Freeze for StructHandle
impl !RefUnwindSafe for StructHandle
impl !Send for StructHandle
impl !Sync for StructHandle
impl Unpin for StructHandle
impl UnsafeUnpin for StructHandle
impl !UnwindSafe for StructHandle
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