Skip to main content

ElementTypeDescriptorRegistry

Trait ElementTypeDescriptorRegistry 

Source
pub trait ElementTypeDescriptorRegistry:
    Send
    + Sync
    + Debug
    + 'static {
    // Required method
    fn descriptors(&self) -> Vec<ElementTypeDescriptor>;

    // Provided methods
    fn type_aliases(&self) -> BTreeMap<TypeId, TypeId> { ... }
    fn valid_type_ids(&self) -> BTreeSet<TypeId> { ... }
    fn descriptor(&self, type_id: &TypeId) -> Option<ElementTypeDescriptor> { ... }
    fn has_infrastructure_type(&self) -> bool { ... }
}
Expand description

Host-provided catalogue of element-type descriptors.

Only place in the elements layer where dyn Trait appears; it’s an embedding-system service, not part of the element algebra itself.

Required Methods§

Source

fn descriptors(&self) -> Vec<ElementTypeDescriptor>

Every descriptor the registry knows about.

Provided Methods§

Source

fn type_aliases(&self) -> BTreeMap<TypeId, TypeId>

Type aliases that resolve to canonical type ids. Default empty.

Source

fn valid_type_ids(&self) -> BTreeSet<TypeId>

Set of valid canonical type ids (derived from Self::descriptors).

Source

fn descriptor(&self, type_id: &TypeId) -> Option<ElementTypeDescriptor>

Look up one descriptor by canonical type id.

Source

fn has_infrastructure_type(&self) -> bool

true when any registered descriptor carries provides_infrastructure.

Implementors§