[][src]Struct init_tree::InitTree

pub struct InitTree { /* fields omitted */ }

A tree of types to initialize.

Methods

impl InitTree[src]

pub fn new() -> Self[src]

pub fn enable_caching(&mut self, enabled: bool)[src]

InitTree supports the use of a cache between initializations. It's common for the initialization sequence to be identical between runs. If you find that the process of discovering dependencies is slowing down your initialization you can cache the results of this discovery to make future initializations faster.

One might for example serialize the cache to a file after initialization and load it from that file when initializing in the future.

pub fn load_cache(&mut self, cache: Cache) -> Option<Cache>[src]

Loads a new cache in, returning the old one, if any. This will automatically enable caching.

pub fn add<T: 'static + Init>(&mut self)[src]

Request that this tree initialize the provided type T

pub fn init(self) -> InitializedTree[src]

Initializes the tree, returning a fully initialized tree, and if caching is enabled, a cache from this initialization.

Trait Implementations

impl Clone for InitTree[src]

impl Default for InitTree[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T> Init for T where
    T: 'static + Default
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.