macro_rules! impl_init {
($t:ty; ($($arg:ident: &mut $arg_type:ty),*) $init:block) => { ... };
}
Expand description
Provides an impl of the Init
trait for a type.
This is structured roughly as a function definition. The only acceptable args for it are
mutable references to other structures with an Init
or Default
implementation.
ยงExample
#[derive(Default, PartialEq, Eq, Debug)]
struct InitDependency;
#[derive(PartialEq, Eq, Debug)]
struct InitMe;
impl_init!(InitMe; (_dep: &mut InitDependency) {
InitMe
});