pub trait Clone: Sized {
    // Required method
    fn clone(&self) -> Self;

    // Provided method
    fn clone_from(&mut self, source: &Self) { ... }
}
๐Ÿ”ฌThis is a nightly-only experimental API. (prelude_future)
Expand description

A common trait for the ability to explicitly duplicate an object.

Differs from Copy in that Copy is implicit and an inexpensive bit-wise copy, while Clone is always explicit and may or may not be expensive. In order to enforce these characteristics, Rust does not allow you to reimplement Copy, but you may reimplement Clone and run arbitrary code.

Since Clone is more general than Copy, you can automatically make anything Copy be Clone as well.

ยงDerivable

This trait can be used with #[derive] if all fields are Clone. The derived implementation of Clone calls clone on each field.

For a generic struct, #[derive] implements Clone conditionally by adding bound Clone on generic parameters.

// `derive` implements Clone for Reading<T> when T is Clone.
#[derive(Clone)]
struct Reading<T> {
    frequency: T,
}

ยงHow can I implement Clone?

Types that are Copy should have a trivial implementation of Clone. More formally: if T: Copy, x: T, and y: &T, then let x = y.clone(); is equivalent to let x = *y;. Manual implementations should be careful to uphold this invariant; however, unsafe code must not rely on it to ensure memory safety.

An example is a generic struct holding a function pointer. In this case, the implementation of Clone cannot be derived, but can be implemented as:

struct Generate<T>(fn() -> T);

impl<T> Copy for Generate<T> {}

impl<T> Clone for Generate<T> {
    fn clone(&self) -> Self {
        *self
    }
}

If we derive:

#[derive(Copy, Clone)]
struct Generate<T>(fn() -> T);

the auto-derived implementations will have unnecessary T: Copy and T: Clone bounds:


// Automatically derived
impl<T: Copy> Copy for Generate<T> { }

// Automatically derived
impl<T: Clone> Clone for Generate<T> {
    fn clone(&self) -> Generate<T> {
        Generate(Clone::clone(&self.0))
    }
}

The bounds are unnecessary because clearly the function itself should be copy- and cloneable even if its return type is not:

โ“˜
#[derive(Copy, Clone)]
struct Generate<T>(fn() -> T);

struct NotCloneable;

fn generate_not_cloneable() -> NotCloneable {
    NotCloneable
}

Generate(generate_not_cloneable).clone(); // error: trait bounds were not satisfied
// Note: With the manual implementations the above line will compile.

ยงAdditional implementors

In addition to the implementors listed below, the following types also implement Clone:

  • Function item types (i.e., the distinct types defined for each function)
  • Function pointer types (e.g., fn() -> i32)
  • Closure types, if they capture no value from the environment or if all such captured values implement Clone themselves. Note that variables captured by shared reference always implement Clone (even if the referent doesnโ€™t), while variables captured by mutable reference never implement Clone.

Required Methodsยง

1.0.0 ยท Source

fn clone(&self) -> Self

Returns a copy of the value.

ยงExamples
let hello = "Hello"; // &str implements Clone

assert_eq!("Hello", hello.clone());

Provided Methodsยง

1.0.0 ยท Source

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.

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ยง

Sourceยง

impl Clone for FullDecoded

Sourceยง

impl Clone for core::num::flt2dec::Sign

Sourceยง

impl Clone for AsciiChar

1.0.0 ยท Sourceยง

impl Clone for rustc_std_workspace_std::cmp::Ordering

Sourceยง

impl Clone for TryReserveErrorKind

1.34.0 ยท Sourceยง

impl Clone for Infallible

1.0.0 ยท Sourceยง

impl Clone for VarError

1.64.0 ยท Sourceยง

impl Clone for FromBytesWithNulError

1.28.0 ยท Sourceยง

impl Clone for rustc_std_workspace_std::fmt::Alignment

Sourceยง

impl Clone for DebugAsHex

Sourceยง

impl Clone for rustc_std_workspace_std::fmt::Sign

1.0.0 ยท Sourceยง

impl Clone for ErrorKind

1.0.0 ยท Sourceยง

impl Clone for SeekFrom

1.7.0 ยท Sourceยง

impl Clone for IpAddr

Sourceยง

impl Clone for Ipv6MulticastScope

1.0.0 ยท Sourceยง

impl Clone for Shutdown

1.0.0 ยท Sourceยง

impl Clone for rustc_std_workspace_std::net::SocketAddr

1.0.0 ยท Sourceยง

impl Clone for FpCategory

1.55.0 ยท Sourceยง

impl Clone for IntErrorKind

Sourceยง

impl Clone for BacktraceStyle

1.86.0 ยท Sourceยง

impl Clone for GetDisjointMutError

Sourceยง

impl Clone for SearchStep

1.0.0 ยท Sourceยง

impl Clone for rustc_std_workspace_std::sync::atomic::Ordering

1.12.0 ยท Sourceยง

impl Clone for RecvTimeoutError

1.0.0 ยท Sourceยง

impl Clone for TryRecvError

1.0.0 ยท Sourceยง

impl Clone for bool

1.0.0 ยท Sourceยง

impl Clone for char

1.0.0 ยท Sourceยง

impl Clone for f16

1.0.0 ยท Sourceยง

impl Clone for f32

1.0.0 ยท Sourceยง

impl Clone for f64

1.0.0 ยท Sourceยง

impl Clone for f128

1.0.0 ยท Sourceยง

impl Clone for i8

1.0.0 ยท Sourceยง

impl Clone for i16

1.0.0 ยท Sourceยง

impl Clone for i32

1.0.0 ยท Sourceยง

impl Clone for i64

1.0.0 ยท Sourceยง

impl Clone for i128

1.0.0 ยท Sourceยง

impl Clone for isize

Sourceยง

impl Clone for !

1.0.0 ยท Sourceยง

impl Clone for u8

1.0.0 ยท Sourceยง

impl Clone for u16

1.0.0 ยท Sourceยง

impl Clone for u32

1.0.0 ยท Sourceยง

impl Clone for u64

1.0.0 ยท Sourceยง

impl Clone for u128

1.0.0 ยท Sourceยง

impl Clone for usize

Sourceยง

impl Clone for Big32x40

Sourceยง

impl Clone for Big8x3

Sourceยง

impl Clone for Decimal

Sourceยง

impl Clone for DecimalSeq

Sourceยง

impl Clone for Fp

Sourceยง

impl Clone for Decoded

Sourceยง

impl Clone for I32NotAllOnes

Sourceยง

impl Clone for I64NotAllOnes

Sourceยง

impl Clone for Nanoseconds

Sourceยง

impl Clone for NonZeroI8Inner

Sourceยง

impl Clone for NonZeroI16Inner

Sourceยง

impl Clone for NonZeroI32Inner

Sourceยง

impl Clone for NonZeroI64Inner

Sourceยง

impl Clone for NonZeroI128Inner

Sourceยง

impl Clone for NonZeroIsizeInner

Sourceยง

impl Clone for NonZeroU8Inner

Sourceยง

impl Clone for NonZeroU16Inner

Sourceยง

impl Clone for NonZeroU32Inner

Sourceยง

impl Clone for NonZeroU64Inner

Sourceยง

impl Clone for NonZeroU128Inner

Sourceยง

impl Clone for NonZeroUsizeInner

Sourceยง

impl Clone for U32NotAllOnes

Sourceยง

impl Clone for U64NotAllOnes

Sourceยง

impl Clone for UsizeNoHighBit

Sourceยง

impl Clone for AllocError

Sourceยง

impl Clone for Global

1.28.0 ยท Sourceยง

impl Clone for Layout

1.50.0 ยท Sourceยง

impl Clone for LayoutError

1.28.0 ยท Sourceยง

impl Clone for System

1.0.0 ยท Sourceยง

impl Clone for TypeId

1.27.0 ยท Sourceยง

impl Clone for CpuidResult

1.27.0 ยท Sourceยง

impl Clone for __m128

Sourceยง

impl Clone for __m128bh

1.27.0 ยท Sourceยง

impl Clone for __m128d

Sourceยง

impl Clone for __m128h

1.27.0 ยท Sourceยง

impl Clone for __m128i

1.27.0 ยท Sourceยง

impl Clone for __m256

Sourceยง

impl Clone for __m256bh

1.27.0 ยท Sourceยง

impl Clone for __m256d

Sourceยง

impl Clone for __m256h

1.27.0 ยท Sourceยง

impl Clone for __m256i

1.72.0 ยท Sourceยง

impl Clone for __m512

Sourceยง

impl Clone for __m512bh

1.72.0 ยท Sourceยง

impl Clone for __m512d

Sourceยง

impl Clone for __m512h

1.72.0 ยท Sourceยง

impl Clone for __m512i

Sourceยง

impl Clone for bf16

1.34.0 ยท Sourceยง

impl Clone for TryFromSliceError

1.0.0 ยท Sourceยง

impl Clone for rustc_std_workspace_std::ascii::EscapeDefault

1.3.0 ยท Sourceยง

impl Clone for Box<str>

Sourceยง

impl Clone for Box<ByteStr>

1.29.0 ยท Sourceยง

impl Clone for Box<CStr>

1.29.0 ยท Sourceยง

impl Clone for Box<OsStr>

1.29.0 ยท Sourceยง

impl Clone for Box<Path>

Sourceยง

impl Clone for ByteString

1.34.0 ยท Sourceยง

impl Clone for CharTryFromError

1.9.0 ยท Sourceยง

impl Clone for DecodeUtf16Error

1.20.0 ยท Sourceยง

impl Clone for rustc_std_workspace_std::char::EscapeDebug

1.0.0 ยท Sourceยง

impl Clone for rustc_std_workspace_std::char::EscapeDefault

1.0.0 ยท Sourceยง

impl Clone for rustc_std_workspace_std::char::EscapeUnicode

1.20.0 ยท Sourceยง

impl Clone for ParseCharError

1.0.0 ยท Sourceยง

impl Clone for ToLowercase

1.0.0 ยท Sourceยง

impl Clone for ToUppercase

1.59.0 ยท Sourceยง

impl Clone for TryFromCharError

Sourceยง

impl Clone for UnorderedKeyError

1.57.0 ยท Sourceยง

impl Clone for TryReserveError

1.64.0 ยท Sourceยง

impl Clone for CString

1.69.0 ยท Sourceยง

impl Clone for FromBytesUntilNulError

1.64.0 ยท Sourceยง

impl Clone for FromVecWithNulError

1.64.0 ยท Sourceยง

impl Clone for IntoStringError

1.64.0 ยท Sourceยง

impl Clone for NulError

1.0.0 ยท Sourceยง

impl Clone for OsString

1.0.0 ยท Sourceยง

impl Clone for Error

Sourceยง

impl Clone for FormattingOptions

1.75.0 ยท Sourceยง

impl Clone for FileTimes

1.1.0 ยท Sourceยง

impl Clone for FileType

1.0.0 ยท Sourceยง

impl Clone for Metadata

1.0.0 ยท Sourceยง

impl Clone for OpenOptions

1.0.0 ยท Sourceยง

impl Clone for Permissions

Sourceยง

impl Clone for ResumeTy

1.7.0 ยท Sourceยง

impl Clone for DefaultHasher

1.7.0 ยท Sourceยง

impl Clone for RandomState

Sourceยง

impl Clone for SipHasher13

1.0.0 ยท Sourceยง

impl Clone for SipHasher

1.0.0 ยท Sourceยง

impl Clone for rustc_std_workspace_std::io::Empty

1.0.0 ยท Sourceยง

impl Clone for Sink

1.33.0 ยท Sourceยง

impl Clone for PhantomPinned

Sourceยง

impl Clone for Assume

1.0.0 ยท Sourceยง

impl Clone for AddrParseError

1.0.0 ยท Sourceยง

impl Clone for Ipv4Addr

1.0.0 ยท Sourceยง

impl Clone for Ipv6Addr

1.0.0 ยท Sourceยง

impl Clone for SocketAddrV4

1.0.0 ยท Sourceยง

impl Clone for SocketAddrV6

1.0.0 ยท Sourceยง

impl Clone for ParseFloatError

1.0.0 ยท Sourceยง

impl Clone for ParseIntError

1.34.0 ยท Sourceยง

impl Clone for TryFromIntError

1.0.0 ยท Sourceยง

impl Clone for RangeFull

1.1.0 ยท Sourceยง

impl Clone for stat

1.10.0 ยท Sourceยง

impl Clone for rustc_std_workspace_std::os::unix::net::SocketAddr

Sourceยง

impl Clone for SocketCred

Sourceยง

impl Clone for UCred

1.0.0 ยท Sourceยง

impl Clone for PathBuf

1.7.0 ยท Sourceยง

impl Clone for StripPrefixError

1.61.0 ยท Sourceยง

impl Clone for ExitCode

1.0.0 ยท Sourceยง

impl Clone for ExitStatus

Sourceยง

impl Clone for ExitStatusError

1.0.0 ยท Sourceยง

impl Clone for Output

Sourceยง

impl Clone for rustc_std_workspace_std::ptr::Alignment

Sourceยง

impl Clone for DefaultRandomSource

1.0.0 ยท Sourceยง

impl Clone for ParseBoolError

1.0.0 ยท Sourceยง

impl Clone for Utf8Error

1.0.0 ยท Sourceยง

impl Clone for FromUtf8Error

Sourceยง

impl Clone for IntoChars

1.0.0 ยท Sourceยง

impl Clone for String

1.0.0 ยท Sourceยง

impl Clone for RecvError

1.5.0 ยท Sourceยง

impl Clone for WaitTimeoutResult

Sourceยง

impl Clone for LocalWaker

1.36.0 ยท Sourceยง

impl Clone for RawWakerVTable

1.36.0 ยท Sourceยง

impl Clone for Waker

1.26.0 ยท Sourceยง

impl Clone for AccessError

1.0.0 ยท Sourceยง

impl Clone for Thread

1.19.0 ยท Sourceยง

impl Clone for ThreadId

1.3.0 ยท Sourceยง

impl Clone for Duration

1.8.0 ยท Sourceยง

impl Clone for Instant

1.8.0 ยท Sourceยง

impl Clone for SystemTime

1.8.0 ยท Sourceยง

impl Clone for SystemTimeError

1.66.0 ยท Sourceยง

impl Clone for TryFromFloatSecsError

Sourceยง

impl<'a> Clone for Part<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for Component<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for Prefix<'a>

Sourceยง

impl<'a> Clone for Utf8Pattern<'a>

Sourceยง

impl<'a> Clone for Source<'a>

Sourceยง

impl<'a> Clone for core::ffi::c_str::Bytes<'a>

Sourceยง

impl<'a> Clone for Formatted<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for Arguments<'a>

1.36.0 ยท Sourceยง

impl<'a> Clone for IoSlice<'a>

Sourceยง

impl<'a> Clone for PhantomContravariantLifetime<'a>

Sourceยง

impl<'a> Clone for PhantomCovariantLifetime<'a>

Sourceยง

impl<'a> Clone for PhantomInvariantLifetime<'a>

1.10.0 ยท Sourceยง

impl<'a> Clone for Location<'a>

1.28.0 ยท Sourceยง

impl<'a> Clone for Ancestors<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for Components<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for rustc_std_workspace_std::path::Iter<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for PrefixComponent<'a>

1.60.0 ยท Sourceยง

impl<'a> Clone for EscapeAscii<'a>

Sourceยง

impl<'a> Clone for CharSearcher<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for rustc_std_workspace_std::str::Bytes<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for CharIndices<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for Chars<'a>

1.8.0 ยท Sourceยง

impl<'a> Clone for EncodeUtf16<'a>

1.34.0 ยท Sourceยง

impl<'a> Clone for rustc_std_workspace_std::str::EscapeDebug<'a>

1.34.0 ยท Sourceยง

impl<'a> Clone for rustc_std_workspace_std::str::EscapeDefault<'a>

1.34.0 ยท Sourceยง

impl<'a> Clone for rustc_std_workspace_std::str::EscapeUnicode<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for Lines<'a>

1.0.0 ยท Sourceยง

impl<'a> Clone for LinesAny<'a>

1.34.0 ยท Sourceยง

impl<'a> Clone for SplitAsciiWhitespace<'a>

1.1.0 ยท Sourceยง

impl<'a> Clone for SplitWhitespace<'a>

1.79.0 ยท Sourceยง

impl<'a> Clone for Utf8Chunk<'a>

1.79.0 ยท Sourceยง

impl<'a> Clone for Utf8Chunks<'a>

Sourceยง

impl<'a, 'b> Clone for CharSliceSearcher<'a, 'b>

Sourceยง

impl<'a, 'b> Clone for StrSearcher<'a, 'b>

Sourceยง

impl<'a, 'b, const N: usize> Clone for CharArrayRefSearcher<'a, 'b, N>

Sourceยง

impl<'a, F> Clone for CharPredicateSearcher<'a, F>
where F: Clone + FnMut(char) -> bool,

Sourceยง

impl<'a, K> Clone for rustc_std_workspace_std::collections::btree_set::Cursor<'a, K>
where K: Clone + 'a,

1.5.0 ยท Sourceยง

impl<'a, P> Clone for MatchIndices<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.2.0 ยท Sourceยง

impl<'a, P> Clone for Matches<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.5.0 ยท Sourceยง

impl<'a, P> Clone for RMatchIndices<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.2.0 ยท Sourceยง

impl<'a, P> Clone for RMatches<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.0.0 ยท Sourceยง

impl<'a, P> Clone for rustc_std_workspace_std::str::RSplit<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.0.0 ยท Sourceยง

impl<'a, P> Clone for RSplitN<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.0.0 ยท Sourceยง

impl<'a, P> Clone for RSplitTerminator<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.0.0 ยท Sourceยง

impl<'a, P> Clone for rustc_std_workspace_std::str::Split<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.51.0 ยท Sourceยง

impl<'a, P> Clone for rustc_std_workspace_std::str::SplitInclusive<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.0.0 ยท Sourceยง

impl<'a, P> Clone for SplitN<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.0.0 ยท Sourceยง

impl<'a, P> Clone for SplitTerminator<'a, P>
where P: Pattern, <P as Pattern>::Searcher<'a>: Clone,

1.31.0 ยท Sourceยง

impl<'a, T> Clone for RChunksExact<'a, T>

Sourceยง

impl<'a, T, const N: usize> Clone for ArrayWindows<'a, T, N>
where T: Clone + 'a,

Sourceยง

impl<'a, const N: usize> Clone for CharArraySearcher<'a, N>

Sourceยง

impl<'f> Clone for VaListImpl<'f>

1.63.0 ยท Sourceยง

impl<'fd> Clone for BorrowedFd<'fd>

1.0.0 ยท Sourceยง

impl<A> Clone for Repeat<A>
where A: Clone,

1.82.0 ยท Sourceยง

impl<A> Clone for RepeatN<A>
where A: Clone,

1.0.0 ยท Sourceยง

impl<A> Clone for rustc_std_workspace_std::option::IntoIter<A>
where A: Clone,

1.0.0 ยท Sourceยง

impl<A> Clone for rustc_std_workspace_std::option::Iter<'_, A>

Sourceยง

impl<A> Clone for IterRange<A>
where A: Clone,

Sourceยง

impl<A> Clone for IterRangeFrom<A>
where A: Clone,

Sourceยง

impl<A> Clone for IterRangeInclusive<A>
where A: Clone,

1.0.0 ยท Sourceยง

impl<A, B> Clone for Chain<A, B>
where A: Clone, B: Clone,

1.0.0 ยท Sourceยง

impl<A, B> Clone for Zip<A, B>
where A: Clone, B: Clone,

1.0.0 ยท Sourceยง

impl<B> Clone for Cow<'_, B>
where B: ToOwned + ?Sized,

1.55.0 ยท Sourceยง

impl<B, C> Clone for ControlFlow<B, C>
where B: Clone, C: Clone,

Sourceยง

impl<Dyn> Clone for DynMetadata<Dyn>
where Dyn: ?Sized,

1.34.0 ยท Sourceยง

impl<F> Clone for FromFn<F>
where F: Clone,

1.43.0 ยท Sourceยง

impl<F> Clone for OnceWith<F>
where F: Clone,

1.28.0 ยท Sourceยง

impl<F> Clone for RepeatWith<F>
where F: Clone,

Sourceยง

impl<G> Clone for FromCoroutine<G>
where G: Clone,

1.7.0 ยท Sourceยง

impl<H> Clone for BuildHasherDefault<H>

Sourceยง

impl<I> Clone for FromIter<I>
where I: Clone,

1.9.0 ยท Sourceยง

impl<I> Clone for DecodeUtf16<I>
where I: Clone + Iterator<Item = u16>,

1.1.0 ยท Sourceยง

impl<I> Clone for Cloned<I>
where I: Clone,

1.36.0 ยท Sourceยง

impl<I> Clone for Copied<I>
where I: Clone,

1.0.0 ยท Sourceยง

impl<I> Clone for Cycle<I>
where I: Clone,

1.0.0 ยท Sourceยง

impl<I> Clone for Enumerate<I>
where I: Clone,

1.0.0 ยท Sourceยง

impl<I> Clone for Fuse<I>
where I: Clone,

Sourceยง

impl<I> Clone for Intersperse<I>
where I: Clone + Iterator, <I as Iterator>::Item: Clone,

1.0.0 ยท Sourceยง

impl<I> Clone for Peekable<I>
where I: Clone + Iterator, <I as Iterator>::Item: Clone,

1.0.0 ยท Sourceยง

impl<I> Clone for Skip<I>
where I: Clone,

1.28.0 ยท Sourceยง

impl<I> Clone for StepBy<I>
where I: Clone,

1.0.0 ยท Sourceยง

impl<I> Clone for Take<I>
where I: Clone,

1.0.0 ยท Sourceยง

impl<I, F> Clone for FilterMap<I, F>
where I: Clone, F: Clone,

1.0.0 ยท Sourceยง

impl<I, F> Clone for Inspect<I, F>
where I: Clone, F: Clone,

1.0.0 ยท Sourceยง

impl<I, F> Clone for Map<I, F>
where I: Clone, F: Clone,

Sourceยง

impl<I, F, const N: usize> Clone for MapWindows<I, F, N>
where I: Iterator + Clone, F: Clone, <I as Iterator>::Item: Clone,

Sourceยง

impl<I, G> Clone for IntersperseWith<I, G>
where I: Iterator + Clone, <I as Iterator>::Item: Clone, G: Clone,

1.0.0 ยท Sourceยง

impl<I, P> Clone for Filter<I, P>
where I: Clone, P: Clone,

1.57.0 ยท Sourceยง

impl<I, P> Clone for MapWhile<I, P>
where I: Clone, P: Clone,

1.0.0 ยท Sourceยง

impl<I, P> Clone for SkipWhile<I, P>
where I: Clone, P: Clone,

1.0.0 ยท Sourceยง

impl<I, P> Clone for TakeWhile<I, P>
where I: Clone, P: Clone,

1.0.0 ยท Sourceยง

impl<I, St, F> Clone for Scan<I, St, F>
where I: Clone, St: Clone, F: Clone,

1.29.0 ยท Sourceยง

impl<I, U> Clone for Flatten<I>
where I: Clone + Iterator, <I as Iterator>::Item: IntoIterator<IntoIter = U, Item = <U as Iterator>::Item>, U: Clone + Iterator,

1.0.0 ยท Sourceยง

impl<I, U, F> Clone for FlatMap<I, U, F>
where I: Clone, F: Clone, U: Clone + IntoIterator, <U as IntoIterator>::IntoIter: Clone,

Sourceยง

impl<I, const N: usize> Clone for rustc_std_workspace_std::iter::ArrayChunks<I, N>
where I: Clone + Iterator, <I as Iterator>::Item: Clone,

1.0.0 ยท Sourceยง

impl<Idx> Clone for rustc_std_workspace_std::ops::Range<Idx>
where Idx: Clone,

1.0.0 ยท Sourceยง

impl<Idx> Clone for rustc_std_workspace_std::ops::RangeFrom<Idx>
where Idx: Clone,

1.26.0 ยท Sourceยง

impl<Idx> Clone for rustc_std_workspace_std::ops::RangeInclusive<Idx>
where Idx: Clone,

1.0.0 ยท Sourceยง

impl<Idx> Clone for RangeTo<Idx>
where Idx: Clone,

1.26.0 ยท Sourceยง

impl<Idx> Clone for RangeToInclusive<Idx>
where Idx: Clone,

Sourceยง

impl<Idx> Clone for rustc_std_workspace_std::range::Range<Idx>
where Idx: Clone,

Sourceยง

impl<Idx> Clone for rustc_std_workspace_std::range::RangeFrom<Idx>
where Idx: Clone,

Sourceยง

impl<Idx> Clone for rustc_std_workspace_std::range::RangeInclusive<Idx>
where Idx: Clone,

1.0.0 ยท Sourceยง

impl<K> Clone for rustc_std_workspace_std::collections::hash_set::Iter<'_, K>

Sourceยง

impl<K, V> Clone for rustc_std_workspace_std::collections::btree_map::Cursor<'_, K, V>

1.0.0 ยท Sourceยง

impl<K, V> Clone for rustc_std_workspace_std::collections::btree_map::Iter<'_, K, V>

1.0.0 ยท Sourceยง

impl<K, V> Clone for rustc_std_workspace_std::collections::btree_map::Keys<'_, K, V>

1.17.0 ยท Sourceยง

impl<K, V> Clone for rustc_std_workspace_std::collections::btree_map::Range<'_, K, V>

1.0.0 ยท Sourceยง

impl<K, V> Clone for rustc_std_workspace_std::collections::btree_map::Values<'_, K, V>

1.0.0 ยท Sourceยง

impl<K, V> Clone for rustc_std_workspace_std::collections::hash_map::Iter<'_, K, V>

1.0.0 ยท Sourceยง

impl<K, V> Clone for rustc_std_workspace_std::collections::hash_map::Keys<'_, K, V>

1.0.0 ยท Sourceยง

impl<K, V> Clone for rustc_std_workspace_std::collections::hash_map::Values<'_, K, V>

1.0.0 ยท Sourceยง

impl<K, V, A> Clone for BTreeMap<K, V, A>
where K: Clone, V: Clone, A: Allocator + Clone,

1.0.0 ยท Sourceยง

impl<K, V, S> Clone for HashMap<K, V, S>
where K: Clone, V: Clone, S: Clone,

1.33.0 ยท Sourceยง

impl<Ptr> Clone for Pin<Ptr>
where Ptr: Clone,

1.0.0 ยท Sourceยง

impl<T> !Clone for &mut T
where T: ?Sized,

Shared references can be cloned, but mutable references cannot!

1.17.0 ยท Sourceยง

impl<T> Clone for Bound<T>
where T: Clone,

1.0.0 ยท Sourceยง

impl<T> Clone for Option<T>
where T: Clone,

Sourceยง

impl<T> Clone for SendTimeoutError<T>
where T: Clone,

1.0.0 ยท Sourceยง

impl<T> Clone for TrySendError<T>
where T: Clone,

1.36.0 ยท Sourceยง

impl<T> Clone for Poll<T>
where T: Clone,

1.0.0 ยท Sourceยง

impl<T> Clone for *const T
where T: ?Sized,

1.0.0 ยท Sourceยง

impl<T> Clone for *mut T
where T: ?Sized,

1.0.0 ยท Sourceยง

impl<T> Clone for &T
where T: ?Sized,

Shared references can be cloned, but mutable references cannot!

1.0.0 ยท Sourceยง

impl<T> Clone for Cell<T>
where T: Copy,

1.70.0 ยท Sourceยง

impl<T> Clone for OnceCell<T>
where T: Clone,

1.0.0 ยท Sourceยง

impl<T> Clone for RefCell<T>
where T: Clone,

1.19.0 ยท Sourceยง

impl<T> Clone for Reverse<T>
where T: Clone,

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::collections::binary_heap::Iter<'_, T>

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::collections::btree_set::Iter<'_, T>

1.17.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::collections::btree_set::Range<'_, T>

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::collections::btree_set::SymmetricDifference<'_, T>

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::collections::btree_set::Union<'_, T>

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::collections::linked_list::Iter<'_, T>

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::collections::vec_deque::Iter<'_, T>

1.48.0 ยท Sourceยง

impl<T> Clone for Pending<T>

1.48.0 ยท Sourceยง

impl<T> Clone for Ready<T>
where T: Clone,

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::io::Cursor<T>
where T: Clone,

1.2.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::iter::Empty<T>

1.2.0 ยท Sourceยง

impl<T> Clone for Once<T>
where T: Clone,

1.0.0 ยท Sourceยง

impl<T> Clone for Rev<T>
where T: Clone,

Sourceยง

impl<T> Clone for PhantomContravariant<T>
where T: ?Sized,

Sourceยง

impl<T> Clone for PhantomCovariant<T>
where T: ?Sized,

1.0.0 ยท Sourceยง

impl<T> Clone for PhantomData<T>
where T: ?Sized,

Sourceยง

impl<T> Clone for PhantomInvariant<T>
where T: ?Sized,

1.21.0 ยท Sourceยง

impl<T> Clone for Discriminant<T>

1.20.0 ยท Sourceยง

impl<T> Clone for ManuallyDrop<T>
where T: Clone + ?Sized,

1.28.0 ยท Sourceยง

impl<T> Clone for NonZero<T>

1.74.0 ยท Sourceยง

impl<T> Clone for Saturating<T>
where T: Clone,

1.0.0 ยท Sourceยง

impl<T> Clone for Wrapping<T>
where T: Clone,

Sourceยง

impl<T> Clone for UnsafePinned<T>
where T: Copy,

1.25.0 ยท Sourceยง

impl<T> Clone for NonNull<T>
where T: ?Sized,

Sourceยง

impl<T> Clone for Unique<T>
where T: ?Sized,

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::result::IntoIter<T>
where T: Clone,

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::result::Iter<'_, T>

1.0.0 ยท Sourceยง

impl<T> Clone for Chunks<'_, T>

1.31.0 ยท Sourceยง

impl<T> Clone for ChunksExact<'_, T>

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::slice::Iter<'_, T>

1.31.0 ยท Sourceยง

impl<T> Clone for RChunks<'_, T>

1.0.0 ยท Sourceยง

impl<T> Clone for Windows<'_, T>

Sourceยง

impl<T> Clone for Receiver<T>

1.0.0 ยท Sourceยง

impl<T> Clone for SendError<T>
where T: Clone,

Sourceยง

impl<T> Clone for rustc_std_workspace_std::sync::mpmc::Sender<T>

1.0.0 ยท Sourceยง

impl<T> Clone for rustc_std_workspace_std::sync::mpsc::Sender<T>

1.0.0 ยท Sourceยง

impl<T> Clone for SyncSender<T>

1.70.0 ยท Sourceยง

impl<T> Clone for OnceLock<T>
where T: Clone,

1.36.0 ยท Sourceยง

impl<T> Clone for MaybeUninit<T>
where T: Copy,

1.3.0 ยท Sourceยง

impl<T, A> Clone for Box<[T], A>
where T: Clone, A: Allocator + Clone,

1.0.0 ยท Sourceยง

impl<T, A> Clone for Box<T, A>
where T: Clone, A: Allocator + Clone,

1.0.0 ยท Sourceยง

impl<T, A> Clone for rustc_std_workspace_std::collections::binary_heap::IntoIter<T, A>
where T: Clone, A: Clone + Allocator,

Sourceยง

impl<T, A> Clone for IntoIterSorted<T, A>
where T: Clone, A: Clone + Allocator,

1.0.0 ยท Sourceยง

impl<T, A> Clone for rustc_std_workspace_std::collections::btree_set::Difference<'_, T, A>
where A: Allocator + Clone,

1.0.0 ยท Sourceยง

impl<T, A> Clone for rustc_std_workspace_std::collections::btree_set::Intersection<'_, T, A>
where A: Allocator + Clone,

Sourceยง

impl<T, A> Clone for rustc_std_workspace_std::collections::linked_list::Cursor<'_, T, A>
where A: Allocator,

1.0.0 ยท Sourceยง

impl<T, A> Clone for rustc_std_workspace_std::collections::linked_list::IntoIter<T, A>
where T: Clone, A: Clone + Allocator,

1.0.0 ยท Sourceยง

impl<T, A> Clone for BTreeSet<T, A>
where T: Clone, A: Allocator + Clone,

1.0.0 ยท Sourceยง

impl<T, A> Clone for BinaryHeap<T, A>
where T: Clone, A: Allocator + Clone,

1.0.0 ยท Sourceยง

impl<T, A> Clone for LinkedList<T, A>
where T: Clone, A: Allocator + Clone,

1.0.0 ยท Sourceยง

impl<T, A> Clone for VecDeque<T, A>
where T: Clone, A: Allocator + Clone,

1.0.0 ยท Sourceยง

impl<T, A> Clone for rustc_std_workspace_std::collections::vec_deque::IntoIter<T, A>
where T: Clone, A: Clone + Allocator,

1.0.0 ยท Sourceยง

impl<T, A> Clone for Rc<T, A>
where A: Allocator + Clone, T: ?Sized,

1.4.0 ยท Sourceยง

impl<T, A> Clone for rustc_std_workspace_std::rc::Weak<T, A>
where A: Allocator + Clone, T: ?Sized,

1.0.0 ยท Sourceยง

impl<T, A> Clone for Arc<T, A>
where A: Allocator + Clone, T: ?Sized,

1.4.0 ยท Sourceยง

impl<T, A> Clone for rustc_std_workspace_std::sync::Weak<T, A>
where A: Allocator + Clone, T: ?Sized,

1.8.0 ยท Sourceยง

impl<T, A> Clone for rustc_std_workspace_std::vec::IntoIter<T, A>
where T: Clone, A: Allocator + Clone,

1.0.0 ยท Sourceยง

impl<T, A> Clone for Vec<T, A>
where T: Clone, A: Allocator + Clone,

1.0.0 ยท Sourceยง

impl<T, E> Clone for Result<T, E>
where T: Clone, E: Clone,

1.34.0 ยท Sourceยง

impl<T, F> Clone for Successors<T, F>
where T: Clone, F: Clone,

1.27.0 ยท Sourceยง

impl<T, P> Clone for rustc_std_workspace_std::slice::RSplit<'_, T, P>
where P: Clone + FnMut(&T) -> bool,

1.0.0 ยท Sourceยง

impl<T, P> Clone for rustc_std_workspace_std::slice::Split<'_, T, P>
where P: Clone + FnMut(&T) -> bool,

1.51.0 ยท Sourceยง

impl<T, P> Clone for rustc_std_workspace_std::slice::SplitInclusive<'_, T, P>
where P: Clone + FnMut(&T) -> bool,

1.0.0 ยท Sourceยง

impl<T, S> Clone for rustc_std_workspace_std::collections::hash_set::Difference<'_, T, S>

1.0.0 ยท Sourceยง

impl<T, S> Clone for rustc_std_workspace_std::collections::hash_set::Intersection<'_, T, S>

1.0.0 ยท Sourceยง

impl<T, S> Clone for rustc_std_workspace_std::collections::hash_set::SymmetricDifference<'_, T, S>

1.0.0 ยท Sourceยง

impl<T, S> Clone for rustc_std_workspace_std::collections::hash_set::Union<'_, T, S>

1.0.0 ยท Sourceยง

impl<T, S> Clone for HashSet<T, S>
where T: Clone, S: Clone,

1.58.0 ยท Sourceยง

impl<T, const N: usize> Clone for [T; N]
where T: Clone,

1.51.0 ยท Sourceยง

impl<T, const N: usize> Clone for rustc_std_workspace_std::array::IntoIter<T, N>
where T: Clone,

Sourceยง

impl<T, const N: usize> Clone for Mask<T, N>

Sourceยง

impl<T, const N: usize> Clone for Simd<T, N>

Sourceยง

impl<T, const N: usize> Clone for rustc_std_workspace_std::slice::ArrayChunks<'_, T, N>

Sourceยง

impl<Y, R> Clone for CoroutineState<Y, R>
where Y: Clone, R: Clone,