[−][src]Struct init_tree::TypeInitDef
Largely an implementation detail. However you may need to create one of these if you're manually
implementing Init
.
Fields
id: fn() -> TypeId
deps: fn() -> &'static [TypeInitDef]
init: fn(_: &mut HashMap<TypeId, Box<dyn Any>>) -> Box<dyn Any>
name: &'static str
Methods
impl TypeInitDef
[src]
pub fn new(
id: fn() -> TypeId,
deps: fn() -> &'static [TypeInitDef],
init: fn(_: &mut HashMap<TypeId, Box<dyn Any>>) -> Box<dyn Any>,
name: &'static str
) -> Self
[src]
id: fn() -> TypeId,
deps: fn() -> &'static [TypeInitDef],
init: fn(_: &mut HashMap<TypeId, Box<dyn Any>>) -> Box<dyn Any>,
name: &'static str
) -> Self
Creates a new instance of this type.
Arguments
id: The TypeId for the type this will be able to construct.
deps: A function returning the list of direct dependencies for the constructed type.
deep_deps: A function which will populate an empty vector with all dependencies for the constructed type. Called recursively on dependencies.
init: A function that retrieves the needed dependencies from a HashMap, initializes the
type, and then returns the instance in a type erased Box
.
name: The name of the type this constructs.
Trait Implementations
impl Clone for TypeInitDef
[src]
fn clone(&self) -> TypeInitDef
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for TypeInitDef
[src]
Auto Trait Implementations
impl RefUnwindSafe for TypeInitDef
impl Send for TypeInitDef
impl Sync for TypeInitDef
impl Unpin for TypeInitDef
impl UnwindSafe for TypeInitDef
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, 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>,