pub struct Object<T> { /* private fields */ }
Expand description

Represents a custom-typed value stored inside a VM.

Built-in types such as f64 shouldn’t be used as the T of an Object, because they are can be represented by values inherently. Object however may be used for binding types that are not directly supported by the VM, like std::fs::File.

Trait Implementations

Converts to this type from the input type.
Returns a GC reference to the user data’s dispatch table.
Converts a reference to UserData to Any.
Returns the user data’s dispatch table. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.