Scope

Trait Scope 

Source
pub trait Scope {
    // Required methods
    fn instance(
        &self,
        definition: &ComponentDefinition,
    ) -> Option<ComponentInstanceAnyPtr>;
    fn store_instance(
        &mut self,
        definition: &ComponentDefinition,
        instance: ComponentInstanceAnyPtr,
    );
}
Expand description

A scope containing component instances. See module documentation for information on scopes.

Required Methods§

Source

fn instance( &self, definition: &ComponentDefinition, ) -> Option<ComponentInstanceAnyPtr>

Gets an instance requested for the given definition, if available in this scope.

Source

fn store_instance( &mut self, definition: &ComponentDefinition, instance: ComponentInstanceAnyPtr, )

Stores given instance in the scope. The scope might not support storing instances and ignore it.

Implementors§