Trait slimmer_box::clone_unsized::CloneUnsized
source · pub trait CloneUnsized {
// Required method
fn unsized_clone_from(&mut self, source: &Self);
}
Expand description
Generalization of Clone which supports dynamically-sized or otherwise unsized types.
Implemented for:
- Normal sized T which implements Clone.
- the dynamicaly-sized slice type
[T]
, as long as T itself implements Clone. - the tynamically-sized string slice type
str
.
This trait could easily be implemented for any other dynamically-sized type as well.
Required Methods§
sourcefn unsized_clone_from(&mut self, source: &Self)
fn unsized_clone_from(&mut self, source: &Self)
Mutates self
to become a clone of source
.
Signature purposefully matches Clone::clone_from
and std::slice::clone_from_slice()
.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl CloneUnsized for str
impl CloneUnsized for str
fn unsized_clone_from(&mut self, source: &Self)
source§impl<T> CloneUnsized for [T]where
T: Clone,
impl<T> CloneUnsized for [T]where
T: Clone,
fn unsized_clone_from(&mut self, source: &Self)
Implementors§
impl<T: Clone> CloneUnsized for T
Blanket implementation for any sized T that uses the normal Clone.