The Clone trait for types that cannot be "implicitly copied"

In Rust, some simple types are "implicitly copyable" and when you assign them or pass them as arguments, the receiver will get a copy, leaving the original value in place. These types do not require allocation to copy and do not have finalizers (i.e. they do not contain owned pointers or implement Drop), so the compiler considers them cheap and safe to copy and automatically implements the Copy trait for them. For other types copies must be made explicitly, by convention implementing the Clone trait and calling the clone method.

Trait Clone

Method clone

fn clone(&self) -> Self

Implementation of Clone for ()

Method clone

fn clone(&self)

Implementation of Clone for ~T where <T: Clone>

Method clone

fn clone(&self) -> ~T

Implementation of Clone for int

Method clone

fn clone(&self) -> int

Implementation of Clone for i8

Method clone

fn clone(&self) -> i8

Implementation of Clone for i16

Method clone

fn clone(&self) -> i16

Implementation of Clone for i32

Method clone

fn clone(&self) -> i32

Implementation of Clone for i64

Method clone

fn clone(&self) -> i64

Implementation of Clone for uint

Method clone

fn clone(&self) -> uint

Implementation of Clone for u8

Method clone

fn clone(&self) -> u8

Implementation of Clone for u16

Method clone

fn clone(&self) -> u16

Implementation of Clone for u32

Method clone

fn clone(&self) -> u32

Implementation of Clone for u64

Method clone

fn clone(&self) -> u64

Implementation of Clone for float

Method clone

fn clone(&self) -> float

Implementation of Clone for f32

Method clone

fn clone(&self) -> f32

Implementation of Clone for f64

Method clone

fn clone(&self) -> f64

Implementation of Clone for bool

Method clone

fn clone(&self) -> bool

Implementation of Clone for char

Method clone

fn clone(&self) -> char