Duplicate

Trait Duplicate 

Source
pub trait Duplicate {
    // Required method
    fn dup(&self) -> Self;
}
Expand description

A trait for duplicating a value via Copy if possible, otherwise via Clone.

This trait is implemented by the #[derive(Duplicate)] attribute. Manually implementing this trait is allowed but not recommended.

Required Methods§

Source

fn dup(&self) -> Self

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§