pub struct Object<T: 'static> { /* private fields */ }Expand description
A live, type-checked handle to a Rust object in one VM and decision epoch.
Clones share the same object without cloning T. Payload references exist
only during method callbacks. Reset invalidates every handle and releases
the VM’s payload ownership even if an old Rust handle is still retained.
Implementations§
Source§impl<T: 'static> Object<T>
impl<T: 'static> Object<T>
Sourcepub fn as_value(&self) -> Value
pub fn as_value(&self) -> Value
Clones the underlying live value for globals, tables, and callback results.
Sourcepub fn decision_epoch(&self) -> u64
pub fn decision_epoch(&self) -> u64
Returns the decision epoch in which this object was retained.
Sourcepub fn call_method<A: IntoRustiaMulti, R: FromRustiaMulti>(
&self,
lua: &mut Rustia,
name: &str,
args: A,
) -> Result<R>
pub fn call_method<A: IntoRustiaMulti, R: FromRustiaMulti>( &self, lua: &mut Rustia, name: &str, args: A, ) -> Result<R>
Calls a method with Rust arguments and copies all returned values into Rust.
The receiver is supplied automatically. () passes no arguments. Use
call_method_values for object results or
other values that cannot be copied into crate::OwnedValue.
Sourcepub fn call_method_values(
&self,
lua: &mut Rustia,
name: &str,
args: &[Value],
) -> Result<Vec<Value>>
pub fn call_method_values( &self, lua: &mut Rustia, name: &str, args: &[Value], ) -> Result<Vec<Value>>
Calls a method with live arguments and keeps every result live.
Sourcepub fn call_method_in<H: HostSchema, A: IntoRustiaMulti, R: FromRustiaMulti>(
&self,
invocation: &mut Invocation<'_, H>,
name: &str,
args: A,
) -> Result<R>
pub fn call_method_in<H: HostSchema, A: IntoRustiaMulti, R: FromRustiaMulti>( &self, invocation: &mut Invocation<'_, H>, name: &str, args: A, ) -> Result<R>
Calls a method within a typed invocation’s shared budget and record journal.
A conversion or execution error discards this call’s staged records. Guest writes and external application changes remain.
Sourcepub fn call_method_values_in<H: HostSchema>(
&self,
invocation: &mut Invocation<'_, H>,
name: &str,
args: &[Value],
) -> Result<Vec<Value>>
pub fn call_method_values_in<H: HostSchema>( &self, invocation: &mut Invocation<'_, H>, name: &str, args: &[Value], ) -> Result<Vec<Value>>
Calls a method with live values inside a typed invocation.