Types

Struct Types 

Source
pub struct Types { /* private fields */ }
Expand description

Represents a component model types collection.

Implementations§

Source§

impl Types

Source

pub fn new() -> Self

Creates a new types collection.

Source

pub fn defined_types(&self) -> impl Iterator<Item = &DefinedType>

Iterates the defined types in the collection.

Source

pub fn resources(&self) -> impl Iterator<Item = &Resource>

Iterates the resources in the collection.

Source

pub fn func_types(&self) -> impl Iterator<Item = &FuncType>

Iterates the function types in the collection.

Source

pub fn interfaces(&self) -> impl Iterator<Item = &Interface>

Iterates the interfaces in the collection.

Source

pub fn worlds(&self) -> impl Iterator<Item = &World>

Iterates the worlds in the collection.

Source

pub fn modules(&self) -> impl Iterator<Item = &ModuleType>

Iterates the modules in the collection.

Source

pub fn add_defined_type(&mut self, ty: DefinedType) -> DefinedTypeId

Adds a defined value type to the collection.

Source

pub fn add_resource(&mut self, resource: Resource) -> ResourceId

Adds a resource to the collection.

Source

pub fn add_func_type(&mut self, func: FuncType) -> FuncTypeId

Adds a function type to the collection.

Source

pub fn add_interface(&mut self, interface: Interface) -> InterfaceId

Adds an interface (i.e. instance type) to the collection.

Source

pub fn add_world(&mut self, world: World) -> WorldId

Adds a world (i.e. component type) to the collection.

Source

pub fn add_module_type(&mut self, module: ModuleType) -> ModuleTypeId

Adds a module type to the collection.

Source

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.

Source

pub fn resolve_value_type(&self, ty: ValueType) -> ValueType

Resolves a value type to a un-aliased value type.

Source

pub fn resolve_resource(&self, id: ResourceId) -> ResourceId

Resolves any aliased resource id to the underlying defined resource id.

Trait Implementations§

Source§

impl Clone for Types

Source§

fn clone(&self) -> Types

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Types

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Types

Source§

fn default() -> Types

Returns the “default value” for a type. Read more
Source§

impl Index<DefinedTypeId> for Types

Source§

type Output = DefinedType

The returned type after indexing.
Source§

fn index(&self, id: DefinedTypeId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<FuncTypeId> for Types

Source§

type Output = FuncType

The returned type after indexing.
Source§

fn index(&self, id: FuncTypeId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<InterfaceId> for Types

Source§

type Output = Interface

The returned type after indexing.
Source§

fn index(&self, id: InterfaceId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<ModuleTypeId> for Types

Source§

type Output = ModuleType

The returned type after indexing.
Source§

fn index(&self, id: ModuleTypeId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<ResourceId> for Types

Source§

type Output = Resource

The returned type after indexing.
Source§

fn index(&self, id: ResourceId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<WorldId> for Types

Source§

type Output = World

The returned type after indexing.
Source§

fn index(&self, id: WorldId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<DefinedTypeId> for Types

Source§

fn index_mut(&mut self, id: DefinedTypeId) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<FuncTypeId> for Types

Source§

fn index_mut(&mut self, id: FuncTypeId) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<InterfaceId> for Types

Source§

fn index_mut(&mut self, id: InterfaceId) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<ModuleTypeId> for Types

Source§

fn index_mut(&mut self, id: ModuleTypeId) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<ResourceId> for Types

Source§

fn index_mut(&mut self, id: ResourceId) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<WorldId> for Types

Source§

fn index_mut(&mut self, id: WorldId) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.