[−][src]Struct abscissa_core::component::Registry
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]
A: Application,
pub fn register<I>(&mut self, components: I) -> Result<(), FrameworkError> where
I: IntoIterator<Item = Box<dyn Component<A>>>,
[src]
I: IntoIterator<Item = Box<dyn Component<A>>>,
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]
&self,
app: &A,
shutdown: Shutdown
) -> Result<(), FrameworkError>
Shutdown components (in the reverse order they were started)
impl<A> Registry<A> where
A: Application + 'static,
[src]
A: Application + 'static,
pub fn get_ref<C>(&self) -> Option<&C> where
C: Component<A> + 'static,
[src]
C: Component<A> + 'static,
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]
C: Component<A> + 'static,
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]
A: Application,
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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,