pub struct Types { /* private fields */ }Expand description
Represents a component model types collection.
Implementations§
source§impl Types
impl Types
sourcepub fn defined_types(&self) -> impl Iterator<Item = &DefinedType>
pub fn defined_types(&self) -> impl Iterator<Item = &DefinedType>
Iterates the defined types in the collection.
sourcepub fn resources(&self) -> impl Iterator<Item = &Resource>
pub fn resources(&self) -> impl Iterator<Item = &Resource>
Iterates the resources in the collection.
sourcepub fn func_types(&self) -> impl Iterator<Item = &FuncType>
pub fn func_types(&self) -> impl Iterator<Item = &FuncType>
Iterates the function types in the collection.
sourcepub fn interfaces(&self) -> impl Iterator<Item = &Interface>
pub fn interfaces(&self) -> impl Iterator<Item = &Interface>
Iterates the interfaces in the collection.
sourcepub fn modules(&self) -> impl Iterator<Item = &ModuleType>
pub fn modules(&self) -> impl Iterator<Item = &ModuleType>
Iterates the modules in the collection.
sourcepub fn add_defined_type(&mut self, ty: DefinedType) -> DefinedTypeId
pub fn add_defined_type(&mut self, ty: DefinedType) -> DefinedTypeId
Adds a defined value type to the collection.
sourcepub fn add_resource(&mut self, resource: Resource) -> ResourceId
pub fn add_resource(&mut self, resource: Resource) -> ResourceId
Adds a resource to the collection.
sourcepub fn add_func_type(&mut self, func: FuncType) -> FuncTypeId
pub fn add_func_type(&mut self, func: FuncType) -> FuncTypeId
Adds a function type to the collection.
sourcepub fn add_interface(&mut self, interface: Interface) -> InterfaceId
pub fn add_interface(&mut self, interface: Interface) -> InterfaceId
Adds an interface (i.e. instance type) to the collection.
sourcepub fn add_world(&mut self, world: World) -> WorldId
pub fn add_world(&mut self, world: World) -> WorldId
Adds a world (i.e. component type) to the collection.
sourcepub fn add_module_type(&mut self, module: ModuleType) -> ModuleTypeId
pub fn add_module_type(&mut self, module: ModuleType) -> ModuleTypeId
Adds a module type to the collection.
sourcepub fn contains(&self, ty: Type) -> bool
pub fn contains(&self, ty: Type) -> bool
Determines if the given type is defined in this collection.
Note that primitive types are always considered part of a collection.
sourcepub fn resolve_value_type(&self, ty: ValueType) -> ValueType
pub fn resolve_value_type(&self, ty: ValueType) -> ValueType
Resolves a value type to a un-aliased value type.
sourcepub fn resolve_resource(&self, id: ResourceId) -> ResourceId
pub fn resolve_resource(&self, id: ResourceId) -> ResourceId
Resolves any aliased resource id to the underlying defined resource id.
Trait Implementations§
source§impl Index<DefinedTypeId> for Types
impl Index<DefinedTypeId> for Types
§type Output = DefinedType
type Output = DefinedType
source§impl Index<FuncTypeId> for Types
impl Index<FuncTypeId> for Types
source§impl Index<InterfaceId> for Types
impl Index<InterfaceId> for Types
source§impl Index<ModuleTypeId> for Types
impl Index<ModuleTypeId> for Types
§type Output = ModuleType
type Output = ModuleType
source§impl Index<ResourceId> for Types
impl Index<ResourceId> for Types
source§impl IndexMut<DefinedTypeId> for Types
impl IndexMut<DefinedTypeId> for Types
source§impl IndexMut<FuncTypeId> for Types
impl IndexMut<FuncTypeId> for Types
source§impl IndexMut<InterfaceId> for Types
impl IndexMut<InterfaceId> for Types
source§impl IndexMut<ModuleTypeId> for Types
impl IndexMut<ModuleTypeId> for Types
source§impl IndexMut<ResourceId> for Types
impl IndexMut<ResourceId> for Types
Auto Trait Implementations§
impl Freeze for Types
impl RefUnwindSafe for Types
impl Send for Types
impl Sync for Types
impl Unpin for Types
impl UnwindSafe for Types
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)