Rust · Trait
Clone
The Clone trait creates an explicit duplicate of a value. Call .clone() when normal assignment would move the value, and use #[derive(Clone)] when the fields support it.
Last updated
- Since
- 1.0.0
Syntax
pub trait Clone {
fn clone(&self) -> Self;
}In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
CopyClone Derive macrostd::clonecore::clone