pub enum TypeResourceTable {
Concrete {
ty: ResourceIndex,
instance: RuntimeComponentInstanceIndex,
},
Abstract(AbstractResourceIndex),
}
Expand description
Metadata about a resource table added to a component.
Variants§
Concrete
This resource is for an actual concrete resource which has runtime state associated with it.
This is used for any resource which might actually enter a component. For example when a resource is either imported or defined in a component it’ll get this case.
Fields
ty: ResourceIndex
The original resource that this table contains.
This is used when destroying resources within this table since this original definition will know how to execute destructors.
instance: RuntimeComponentInstanceIndex
The component instance that contains this resource table.
Abstract(AbstractResourceIndex)
This table does not actually exist at runtime but instead represents type information for an uninstantiable resource. This tracks, for example, resources in component and instance types.
Implementations§
Source§impl TypeResourceTable
impl TypeResourceTable
Sourcepub fn unwrap_concrete_ty(&self) -> ResourceIndex
pub fn unwrap_concrete_ty(&self) -> ResourceIndex
Asserts that this is TypeResourceTable::Concrete
and returns the ty
field.
§Panics
Panics if this is TypeResourceTable::Abstract
.
Sourcepub fn unwrap_concrete_instance(&self) -> RuntimeComponentInstanceIndex
pub fn unwrap_concrete_instance(&self) -> RuntimeComponentInstanceIndex
Asserts that this is TypeResourceTable::Concrete
and returns the
instance
field.
§Panics
Panics if this is TypeResourceTable::Abstract
.
Trait Implementations§
Source§impl Clone for TypeResourceTable
impl Clone for TypeResourceTable
Source§fn clone(&self) -> TypeResourceTable
fn clone(&self) -> TypeResourceTable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TypeResourceTable
impl Debug for TypeResourceTable
Source§impl<'de> Deserialize<'de> for TypeResourceTable
impl<'de> Deserialize<'de> for TypeResourceTable
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>,
Source§impl Hash for TypeResourceTable
impl Hash for TypeResourceTable
Source§impl PartialEq for TypeResourceTable
impl PartialEq for TypeResourceTable
Source§impl Serialize for TypeResourceTable
impl Serialize for TypeResourceTable
impl Eq for TypeResourceTable
impl StructuralPartialEq for TypeResourceTable
Auto Trait Implementations§
impl Freeze for TypeResourceTable
impl RefUnwindSafe for TypeResourceTable
impl Send for TypeResourceTable
impl Sync for TypeResourceTable
impl Unpin for TypeResourceTable
impl UnwindSafe for TypeResourceTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.