BuildFromContext

Trait BuildFromContext 

Source
pub trait BuildFromContext<E, CtxErr = (), InitErr = ()> {
    // Required method
    fn build_from(ctx: &AppContextBuilder, extras: E) -> Result<Self, CtxErr>
       where Self: Sized;

    // Provided method
    fn init_self(&self) -> Result<(), InitErr> { ... }
}
Expand description

A trait for beans which can be created from AppContextBuilder. ctx is the AppContext for acquiring lazy-initialized beans, and extras are extra params for this build.

Required Methods§

Source

fn build_from(ctx: &AppContextBuilder, extras: E) -> Result<Self, CtxErr>
where Self: Sized,

build the beans from

Provided Methods§

Source

fn init_self(&self) -> Result<(), InitErr>

initialization method after all beans have been built. because of potential cyclic invocations during the initialization, only immutable references are allowed

Implementors§