Trait clone_fields::CloneFields
source · pub trait CloneFields<Target> {
fn clone_into(&self) -> Target;
fn clone_from(other: &Target) -> Self;
}
Expand description
A trait to clone a type into another type field-by-field.
It is automatically implemented for any clonable type, i.e. CloneFields<T> for T
where
T: Clone
.
Refer to clone-fields-derive docs for info on how to automatically derive this trait. Yes, you typically don’t need to do it manually.
Required Methods
sourcefn clone_into(&self) -> Target
fn clone_into(&self) -> Target
Clones self
into another type by cloning its fields.
sourcefn clone_from(other: &Target) -> Self
fn clone_from(other: &Target) -> Self
Constructs Self
from another type by cloning its fields.