Trait CloneInto

Source
pub trait CloneInto<T> {
    // Required method
    fn clone_into(&self) -> T;
}
Expand description

A trait to clone a type into another type field-by-field.

It is automatically implemented for any type pair for which CloneFrom is implemented, i.e. T1: CloneFrom<T2> => T2: CloneInto<T1>.

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§

Source

fn clone_into(&self) -> T

Clones self into another type by cloning its fields.

Implementors§

Source§

impl<T1, T2> CloneInto<T1> for T2
where T1: CloneFrom<T2>,