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.