[−][src]Struct init_tree::InitTree
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: Vec<usize>) -> Option<Vec<usize>>
[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]
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
Auto Trait Implementations
impl RefUnwindSafe for InitTree
impl Send for InitTree
impl Sync for InitTree
impl Unpin for InitTree
impl UnwindSafe for InitTree
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T> Init for T where
T: 'static + Default,
[src]
T: 'static + Default,
fn init(&mut HashMap<TypeId, Box<dyn Any + 'static>, RandomState>) -> T
[src]
fn self_def() -> TypeInitDef
[src]
fn deps_list() -> &'static [TypeInitDef]
[src]
fn deep_deps_list(&mut Vec<TypeInitDef>, u32)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,