pub struct InitializedTree { /* private fields */ }
Expand description
A collection of all the structures after they’ve been initialized. Call .take::<MyType>()
on
this to obtain the newly initialized structure.
Implementations§
Source§impl InitializedTree
impl InitializedTree
Sourcepub fn take<T: 'static>(&mut self) -> Option<T>
pub fn take<T: 'static>(&mut self) -> Option<T>
Removes the initialized structure from this tree and returns it.
Sourcepub fn take_all(self) -> impl Iterator<Item = (TypeId, Box<dyn Any>)>
pub fn take_all(self) -> impl Iterator<Item = (TypeId, Box<dyn Any>)>
Returns an iterator of all initialized types.
Sourcepub fn take_by_type_id(&mut self, t: TypeId) -> Option<Box<dyn Any>>
pub fn take_by_type_id(&mut self, t: TypeId) -> Option<Box<dyn Any>>
Removes the initialized structure from this tree and returns it. Prefer take()
if possible,
but this function is provided in case the type can’t be determined at compile time.
Sourcepub fn take_cache(&mut self) -> Option<Cache>
pub fn take_cache(&mut self) -> Option<Cache>
Return the cache from this initialization.
Sourcepub fn cache_was_correct(&self) -> bool
pub fn cache_was_correct(&self) -> bool
Returns true if the cache loaded in was completely correct.
Trait Implementations§
Source§impl Default for InitializedTree
impl Default for InitializedTree
Source§fn default() -> InitializedTree
fn default() -> InitializedTree
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InitializedTree
impl !RefUnwindSafe for InitializedTree
impl !Send for InitializedTree
impl !Sync for InitializedTree
impl Unpin for InitializedTree
impl !UnwindSafe for InitializedTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more