Skip to main content

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 a given instance in the scope. The scope might not support storing instances and ignore it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§