[][src]Trait unsegen::container::ContainerProvider

pub trait ContainerProvider {
    type Parameters;
    type Index: Clone + PartialEq;

    const DEFAULT_CONTAINER: Self::Index;

    fn get<'a, 'b: 'a>(
        &'b self,
        index: &'a Self::Index
    ) -> &'b dyn Container<Self::Parameters>;
fn get_mut<'a, 'b: 'a>(
        &'b mut self,
        index: &'a Self::Index
    ) -> &'b mut dyn Container<Self::Parameters>; }

A ContainerProvider stores the individual components (Containers) of an application and allows them to be retrieved based on an index.

Note that every possible value for Self::Index must correspond to a valid component. A good choice for an Index is therefore an enum.

Associated Types

Loading content...

Associated Constants

Loading content...

Required methods

fn get<'a, 'b: 'a>(
    &'b self,
    index: &'a Self::Index
) -> &'b dyn Container<Self::Parameters>

fn get_mut<'a, 'b: 'a>(
    &'b mut self,
    index: &'a Self::Index
) -> &'b mut dyn Container<Self::Parameters>

Loading content...

Implementors

Loading content...