[][src]Struct abscissa_core::component::Registry

pub struct Registry<A: Application> { /* fields omitted */ }

The component registry provides a system for runtime registration of application components which can interact with each other dynamically.

Components are sorted according to a dependency ordering, started in-order, and at application termination time, shut down in reverse order.

Methods

impl<A> Registry<A> where
    A: Application
[src]

pub fn register<I>(&mut self, components: I) -> Result<(), FrameworkError> where
    I: IntoIterator<Item = Box<dyn Component<A>>>, 
[src]

Register components, determining their dependency order

pub fn after_config(&mut self, config: &A::Cfg) -> Result<(), FrameworkError>[src]

Callback fired by application when configuration has been loaded

pub fn iter(&mut self) -> Iter<Box<dyn Component<A>>>[src]

Iterate over the components mutably.

pub fn iter_mut(&mut self) -> IterMut<Box<dyn Component<A>>>[src]

Iterate over the components mutably.

pub fn shutdown(
    &self,
    app: &A,
    shutdown: Shutdown
) -> Result<(), FrameworkError>
[src]

Shutdown components (in the reverse order they were started)

impl<A> Registry<A> where
    A: Application + 'static, 
[src]

pub fn get_ref<C>(&self) -> Option<&C> where
    C: Component<A> + 'static, 
[src]

Get a reference to a component of the given type, if one has been registered

pub fn get_mut<C>(&mut self) -> Option<&mut C> where
    C: Component<A> + 'static, 
[src]

Get a mutable reference component of the given type, if one has been registered

Trait Implementations

impl<A> Default for Registry<A> where
    A: Application
[src]

impl<A: Debug + Application> Debug for Registry<A>[src]

Auto Trait Implementations

impl<A> Unpin for Registry<A>

impl<A> Sync for Registry<A>

impl<A> Send for Registry<A>

impl<A> !RefUnwindSafe for Registry<A>

impl<A> !UnwindSafe for Registry<A>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]