pub struct CloneFactory<T>(/* private fields */);
Expand description
A Factory
that creates instances using T::clone()
method.
§Examples
use factory::{CloneFactory, Factory};
let f = CloneFactory::new(10);
assert_eq!(f.create(), 10);
Implementations§
Source§impl<T: Clone> CloneFactory<T>
impl<T: Clone> CloneFactory<T>
Trait Implementations§
Source§impl<T: Clone> Clone for CloneFactory<T>
impl<T: Clone> Clone for CloneFactory<T>
Source§fn clone(&self) -> CloneFactory<T>
fn clone(&self) -> CloneFactory<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for CloneFactory<T>
impl<T: Debug> Debug for CloneFactory<T>
Source§impl<T: Default> Default for CloneFactory<T>
impl<T: Default> Default for CloneFactory<T>
Source§fn default() -> CloneFactory<T>
fn default() -> CloneFactory<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for CloneFactory<T>where
T: Freeze,
impl<T> RefUnwindSafe for CloneFactory<T>where
T: RefUnwindSafe,
impl<T> Send for CloneFactory<T>where
T: Send,
impl<T> Sync for CloneFactory<T>where
T: Sync,
impl<T> Unpin for CloneFactory<T>where
T: Unpin,
impl<T> UnwindSafe for CloneFactory<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