pub struct DefaultFactory<T>(/* private fields */);
Expand description
A Factory
that creates instances using T::default()
function.
§Examples
use factory::{DefaultFactory, Factory};
let f = DefaultFactory::<u8>::new();
assert_eq!(f.create(), 0);
Implementations§
Trait Implementations§
Source§impl<T> Clone for DefaultFactory<T>
impl<T> Clone for DefaultFactory<T>
Source§impl<T: Debug> Debug for DefaultFactory<T>
impl<T: Debug> Debug for DefaultFactory<T>
Source§impl<T: Default> Default for DefaultFactory<T>
impl<T: Default> Default for DefaultFactory<T>
Source§fn default() -> DefaultFactory<T>
fn default() -> DefaultFactory<T>
Returns the “default value” for a type. Read more
Source§impl<T: Default> Factory for DefaultFactory<T>
impl<T: Default> Factory for DefaultFactory<T>
impl<T> Send for DefaultFactory<T>
impl<T> Sync for DefaultFactory<T>
Auto Trait Implementations§
impl<T> Freeze for DefaultFactory<T>
impl<T> RefUnwindSafe for DefaultFactory<T>where
T: RefUnwindSafe,
impl<T> Unpin for DefaultFactory<T>where
T: Unpin,
impl<T> UnwindSafe for DefaultFactory<T>where
T: UnwindSafe,
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