Struct di::Deps [] [src]

pub struct Deps {
    // some fields omitted
}

Methods

impl Deps
[src]

fn new() -> Deps

fn create<P: Any>(&self, obj: P) -> Result<Scope<P>>

Create dependencies for specified obj and return a wrapper Scope object.

The wrapper Scope keeps ownership of all children together with parent object.

fn collect<C: Any>(&self) -> Result<Collection<C>>

Collect all the items registered as collectable into a Collection of that type.

fn when_ready<T, F>(&mut self, action: F) where T: 'static + Any, F: for<'r> Fn(&Deps, &mut T) -> Result<()> + 'static + Send + Sync

fn attach<P, C, F>(&mut self, constructor: F) where P: 'static + Any, C: 'static + Any, F: for<'r> Fn(&Deps, &mut P) -> Result<C> + 'static + Send + Sync

Single dependency on a parent.

fn bridge<P1, P2, C, F>(&mut self, constructor: F) where P1: 'static + Any + Send + Sync, P2: 'static + Any + Send + Sync, C: 'static + Any, F: for<'r> Fn(&mut P1, &mut P2) -> Result<C> + 'static + Send + Sync

Single dependency on multiple parents.

fn collectable<C, F>(&mut self, constructor: F) where C: 'static + Any, F: for<'r> Fn(&Deps) -> C + 'static + Send + Sync

Trait Implementations

impl Send for Deps
[src]

impl Sync for Deps
[src]