pub trait CheapClone: Clone {
// Provided method
fn cheap_clone(&self) -> Self { ... }
}Expand description
Things that are fast to clone in the context of an application.
The purpose of this API is to reduce the number of calls to .clone() which need to be audited for performance.
As a rule of thumb, only constant-time Clone impls should also implement CheapClone.
Eg:
Provided Methods§
sourcefn cheap_clone(&self) -> Self
fn cheap_clone(&self) -> Self
Returns a copy of the value.
Object Safety§
This trait is not object safe.