Trait CloneFrom

Source
pub trait CloneFrom<T> {
    // Required method
    fn clone_from(other: &T) -> Self;
}
Expand description

Construct a type from another by cloning its fields.

It is automatically implemented for any clonable type, i.e. CloneFrom<T> for T where T: Clone.

Required Methods§

Source

fn clone_from(other: &T) -> Self

Constructs Self from another type by cloning its fields.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Clone> CloneFrom<T> for T