Trait core::clone::Clone
[−]
[src]
pub trait Clone: Sized { fn clone(&self) -> Self; fn clone_from(&mut self, source: &Self) { ... } }
A common trait for cloning an object.
Required Methods
fn clone(&self) -> Self
Returns a copy of the value.
Examples
fn main() { let hello = "Hello"; // &str implements Clone assert_eq!("Hello", hello.clone()); }let hello = "Hello"; // &str implements Clone assert_eq!("Hello", hello.clone());
Provided Methods
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
.
a.clone_from(&b)
is equivalent to a = b.clone()
in functionality,
but can be overridden to reuse the resources of a
to avoid unnecessary
allocations.
Implementors
impl<T: Clone> Clone for Wrapping<T> where T: Clone
impl Clone for FpCategory
impl Clone for ParseIntError
impl Clone for ParseFloatError
impl Clone for FloatErrorKind
impl<T: Clone + Zeroable> Clone for NonZero<T> where T: Clone
impl<T: ?Sized> Clone for *const T
impl<T: ?Sized> Clone for *mut T
impl Clone for NoCopy
impl<T: ?Sized> Clone for PhantomData<T>
impl Clone for RangeFull
impl<Idx: Clone> Clone for Range<Idx> where Idx: Clone, Idx: Clone
impl<Idx: Clone> Clone for RangeFrom<Idx> where Idx: Clone
impl<Idx: Clone> Clone for RangeTo<Idx> where Idx: Clone
impl Clone for Ordering
impl<'a, T: ?Sized> Clone for &'a T
impl Clone for isize
impl Clone for i8
impl Clone for i16
impl Clone for i32
impl Clone for i64
impl Clone for usize
impl Clone for u8
impl Clone for u16
impl Clone for u32
impl Clone for u64
impl Clone for f32
impl Clone for f64
impl Clone for ()
impl Clone for bool
impl Clone for char
impl<ReturnType> Clone for fn() -> ReturnType
impl<ReturnType> Clone for extern "C" fn() -> ReturnType
impl<ReturnType> Clone for unsafe fn() -> ReturnType
impl<ReturnType> Clone for unsafe extern "C" fn() -> ReturnType
impl<A, ReturnType> Clone for fn(A) -> ReturnType
impl<A, ReturnType> Clone for extern "C" fn(A) -> ReturnType
impl<A, ReturnType> Clone for unsafe fn(A) -> ReturnType
impl<A, ReturnType> Clone for unsafe extern "C" fn(A) -> ReturnType
impl<A, B, ReturnType> Clone for fn(A, B) -> ReturnType
impl<A, B, ReturnType> Clone for extern "C" fn(A, B) -> ReturnType
impl<A, B, ReturnType> Clone for unsafe fn(A, B) -> ReturnType
impl<A, B, ReturnType> Clone for unsafe extern "C" fn(A, B) -> ReturnType
impl<A, B, C, ReturnType> Clone for fn(A, B, C) -> ReturnType
impl<A, B, C, ReturnType> Clone for extern "C" fn(A, B, C) -> ReturnType
impl<A, B, C, ReturnType> Clone for unsafe fn(A, B, C) -> ReturnType
impl<A, B, C, ReturnType> Clone for unsafe extern "C" fn(A, B, C) -> ReturnType
impl<A, B, C, D, ReturnType> Clone for fn(A, B, C, D) -> ReturnType
impl<A, B, C, D, ReturnType> Clone for extern "C" fn(A, B, C, D) -> ReturnType
impl<A, B, C, D, ReturnType> Clone for unsafe fn(A, B, C, D) -> ReturnType
impl<A, B, C, D, ReturnType> Clone for unsafe extern "C" fn(A, B, C, D) -> ReturnType
impl<A, B, C, D, E, ReturnType> Clone for fn(A, B, C, D, E) -> ReturnType
impl<A, B, C, D, E, ReturnType> Clone for extern "C" fn(A, B, C, D, E) -> ReturnType
impl<A, B, C, D, E, ReturnType> Clone for unsafe fn(A, B, C, D, E) -> ReturnType
impl<A, B, C, D, E, ReturnType> Clone for unsafe extern "C" fn(A, B, C, D, E) -> ReturnType
impl<A, B, C, D, E, F, ReturnType> Clone for fn(A, B, C, D, E, F) -> ReturnType
impl<A, B, C, D, E, F, ReturnType> Clone for extern "C" fn(A, B, C, D, E, F) -> ReturnType
impl<A, B, C, D, E, F, ReturnType> Clone for unsafe fn(A, B, C, D, E, F) -> ReturnType
impl<A, B, C, D, E, F, ReturnType> Clone for unsafe extern "C" fn(A, B, C, D, E, F) -> ReturnType
impl<A, B, C, D, E, F, G, ReturnType> Clone for fn(A, B, C, D, E, F, G) -> ReturnType
impl<A, B, C, D, E, F, G, ReturnType> Clone for extern "C" fn(A, B, C, D, E, F, G) -> ReturnType
impl<A, B, C, D, E, F, G, ReturnType> Clone for unsafe fn(A, B, C, D, E, F, G) -> ReturnType
impl<A, B, C, D, E, F, G, ReturnType> Clone for unsafe extern "C" fn(A, B, C, D, E, F, G) -> ReturnType
impl<A, B, C, D, E, F, G, H, ReturnType> Clone for fn(A, B, C, D, E, F, G, H) -> ReturnType
impl<A, B, C, D, E, F, G, H, ReturnType> Clone for extern "C" fn(A, B, C, D, E, F, G, H) -> ReturnType
impl<A, B, C, D, E, F, G, H, ReturnType> Clone for unsafe fn(A, B, C, D, E, F, G, H) -> ReturnType
impl<A, B, C, D, E, F, G, H, ReturnType> Clone for unsafe extern "C" fn(A, B, C, D, E, F, G, H) -> ReturnType
impl Clone for TypeId
impl<T: Copy> Clone for [T; 0]
impl<T: Copy> Clone for [T; 1]
impl<T: Copy> Clone for [T; 2]
impl<T: Copy> Clone for [T; 3]
impl<T: Copy> Clone for [T; 4]
impl<T: Copy> Clone for [T; 5]
impl<T: Copy> Clone for [T; 6]
impl<T: Copy> Clone for [T; 7]
impl<T: Copy> Clone for [T; 8]
impl<T: Copy> Clone for [T; 9]
impl<T: Copy> Clone for [T; 10]
impl<T: Copy> Clone for [T; 11]
impl<T: Copy> Clone for [T; 12]
impl<T: Copy> Clone for [T; 13]
impl<T: Copy> Clone for [T; 14]
impl<T: Copy> Clone for [T; 15]
impl<T: Copy> Clone for [T; 16]
impl<T: Copy> Clone for [T; 17]
impl<T: Copy> Clone for [T; 18]
impl<T: Copy> Clone for [T; 19]
impl<T: Copy> Clone for [T; 20]
impl<T: Copy> Clone for [T; 21]
impl<T: Copy> Clone for [T; 22]
impl<T: Copy> Clone for [T; 23]
impl<T: Copy> Clone for [T; 24]
impl<T: Copy> Clone for [T; 25]
impl<T: Copy> Clone for [T; 26]
impl<T: Copy> Clone for [T; 27]
impl<T: Copy> Clone for [T; 28]
impl<T: Copy> Clone for [T; 29]
impl<T: Copy> Clone for [T; 30]
impl<T: Copy> Clone for [T; 31]
impl<T: Copy> Clone for [T; 32]
impl Clone for Ordering
impl<T: Copy> Clone for Cell<T>
impl Clone for BorrowState
impl<T: Clone> Clone for RefCell<T>
impl Clone for EscapeUnicode
impl Clone for EscapeDefault
impl<T: Clone> Clone for Rev<T> where T: Clone
impl<T: Clone> Clone for MinMaxResult<T> where T: Clone, T: Clone, T: Clone
impl<I: Clone> Clone for Cloned<I> where I: Clone
impl<I: Clone> Clone for Cycle<I> where I: Clone, I: Clone
impl<A: Clone, B: Clone> Clone for Chain<A, B> where A: Clone, B: Clone
impl<A: Clone, B: Clone> Clone for Zip<A, B> where A: Clone, B: Clone
impl<I: Clone, F: Clone> Clone for Map<I, F> where I: Clone, F: Clone
impl<I: Clone, P: Clone> Clone for Filter<I, P> where I: Clone, P: Clone
impl<I: Clone, F: Clone> Clone for FilterMap<I, F> where I: Clone, F: Clone
impl<I: Clone> Clone for Enumerate<I> where I: Clone
impl<I: Iterator + Clone> Clone for Peekable<I> where I::Item: Clone
impl<I: Clone, P: Clone> Clone for SkipWhile<I, P> where I: Clone, P: Clone
impl<I: Clone, P: Clone> Clone for TakeWhile<I, P> where I: Clone, P: Clone
impl<I: Clone> Clone for Skip<I> where I: Clone
impl<I: Clone> Clone for Take<I> where I: Clone
impl<I: Clone, St: Clone, F: Clone> Clone for Scan<I, St, F> where I: Clone, F: Clone, St: Clone
impl<I: Clone, U: Clone + IntoIterator, F: Clone> Clone for FlatMap<I, U, F> where I: Clone, F: Clone, U::IntoIter: Clone, U::IntoIter: Clone
impl<I: Clone> Clone for Fuse<I> where I: Clone
impl<I: Clone, F: Clone> Clone for Inspect<I, F> where I: Clone, F: Clone
impl<St: Clone, F: Clone> Clone for Unfold<St, F> where F: Clone, St: Clone
impl<A: Clone, R: Clone> Clone for StepBy<A, R> where A: Clone, R: Clone
impl<A: Clone> Clone for RangeInclusive<A> where A: Clone
impl<A: Clone> Clone for Repeat<A> where A: Clone
impl<T: Clone> Clone for Option<T> where T: Clone
impl<'a, A> Clone for Iter<'a, A>
impl<T> Clone for Slice<T>
impl Clone for TraitObject
impl<T: Clone, E: Clone> Clone for Result<T, E> where T: Clone, E: Clone
impl<'a, T> Clone for Iter<'a, T>
impl Clone for i8x16
impl Clone for i16x8
impl Clone for i32x4
impl Clone for i64x2
impl Clone for u8x16
impl Clone for u16x8
impl Clone for u32x4
impl Clone for u64x2
impl Clone for f32x4
impl Clone for f64x2
impl<'a, T> Clone for Iter<'a, T>
impl<'a, T, P> Clone for Split<'a, T, P> where P: Clone + FnMut(&T) -> bool
impl<'a, T> Clone for Windows<'a, T>
impl<'a, T> Clone for Chunks<'a, T>
impl Clone for SearchStep
impl<'a, 'b> Clone for StrSearcher<'a, 'b>
impl<'a> Clone for CharSearcher<'a>
impl<'a, 'b> Clone for CharSliceSearcher<'a, 'b>
impl<'a, F: Clone> Clone for CharPredicateSearcher<'a, F> where F: FnMut(char) -> bool, F: Clone
impl Clone for ParseBoolError
impl Clone for Utf8Error
impl<'a> Clone for Chars<'a>
impl<'a> Clone for CharIndices<'a>
impl<'a> Clone for Bytes<'a>
impl<'a, P: Pattern<'a>> Clone for Split<'a, P> where P::Searcher: Clone
impl<'a, P: Pattern<'a>> Clone for RSplit<'a, P> where P::Searcher: Clone
impl<'a, P: Pattern<'a>> Clone for SplitTerminator<'a, P> where P::Searcher: Clone
impl<'a, P: Pattern<'a>> Clone for RSplitTerminator<'a, P> where P::Searcher: Clone
impl<'a, P: Pattern<'a>> Clone for SplitN<'a, P> where P::Searcher: Clone
impl<'a, P: Pattern<'a>> Clone for RSplitN<'a, P> where P::Searcher: Clone
impl<'a, P: Pattern<'a>> Clone for MatchIndices<'a, P> where P::Searcher: Clone
impl<'a, P: Pattern<'a>> Clone for RMatchIndices<'a, P> where P::Searcher: Clone
impl<'a, P: Pattern<'a>> Clone for Matches<'a, P> where P::Searcher: Clone
impl<'a, P: Pattern<'a>> Clone for RMatches<'a, P> where P::Searcher: Clone
impl<'a> Clone for Lines<'a>
impl<'a> Clone for LinesAny<'a>
impl Clone for CharRange
impl Clone for SipHasher
impl Clone for Radix
impl<T: Clone, R: Clone> Clone for RadixFmt<T, R> where T: Clone, R: Clone
impl Clone for Error
impl<'a> Clone for Arguments<'a>
impl<A: Clone> Clone for (A,)
impl<A: Clone, B: Clone> Clone for (A, B)
impl<A: Clone, B: Clone, C: Clone> Clone for (A, B, C)
impl<A: Clone, B: Clone, C: Clone, D: Clone> Clone for (A, B, C, D)
impl<A: Clone, B: Clone, C: Clone, D: Clone, E: Clone> Clone for (A, B, C, D, E)
impl<A: Clone, B: Clone, C: Clone, D: Clone, E: Clone, F: Clone> Clone for (A, B, C, D, E, F)
impl<A: Clone, B: Clone, C: Clone, D: Clone, E: Clone, F: Clone, G: Clone> Clone for (A, B, C, D, E, F, G)
impl<A: Clone, B: Clone, C: Clone, D: Clone, E: Clone, F: Clone, G: Clone, H: Clone> Clone for (A, B, C, D, E, F, G, H)
impl<A: Clone, B: Clone, C: Clone, D: Clone, E: Clone, F: Clone, G: Clone, H: Clone, I: Clone> Clone for (A, B, C, D, E, F, G, H, I)
impl<A: Clone, B: Clone, C: Clone, D: Clone, E: Clone, F: Clone, G: Clone, H: Clone, I: Clone, J: Clone> Clone for (A, B, C, D, E, F, G, H, I, J)
impl<A: Clone, B: Clone, C: Clone, D: Clone, E: Clone, F: Clone, G: Clone, H: Clone, I: Clone, J: Clone, K: Clone> Clone for (A, B, C, D, E, F, G, H, I, J, K)
impl<A: Clone, B: Clone, C: Clone, D: Clone, E: Clone, F: Clone, G: Clone, H: Clone, I: Clone, J: Clone, K: Clone, L: Clone> Clone for (A, B, C, D, E, F, G, H, I, J, K, L)