pub struct Resource {
pub index: DefinedResourceIndex,
pub rep: WasmValType,
pub dtor: Option<CoreDef>,
pub instance: RuntimeComponentInstanceIndex,
}
Expand description
Description of a new resource declared in a GlobalInitializer::Resource
variant.
This will have the effect of initializing runtime state for this resource, namely the destructor is fetched and stored.
Fields§
§index: DefinedResourceIndex
The local index of the resource being defined.
rep: WasmValType
Core wasm representation of this resource.
dtor: Option<CoreDef>
Optionally-specified destructor and where it comes from.
instance: RuntimeComponentInstanceIndex
Which component instance this resource logically belongs to.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Resource
impl<'de> Deserialize<'de> for Resource
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
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