pub trait Clone:Sized { // Required method fnclone(&self) -> Self; // Provided method fnclone_from(&mut self, source: &Self)where Self: { ... }}Expand description
A common trait that allows explicit creation of a duplicate value.
Callingclone always produces a new value.However, for types that are references to other data (such as smart pointers or references),the new value may still point to the same underlying data, rather than duplicating it.SeeClone::clone for more details.
This distinction is especially important when using#[derive(Clone)] on structs containingsmart pointers likeArc<Mutex<T>> - the cloned struct will share mutable state with theoriginal.
Differs fromCopy in thatCopy is implicit and an inexpensive bit-wise copy, whileClone is always explicit and may or may not be expensive. In order to enforcethese characteristics, Rust does not allow you to reimplementCopy, but youmay reimplementClone and run arbitrary code.
SinceClone is more general thanCopy, you can automatically make anythingCopy beClone as well.
§Derivable
This trait can be used with#[derive] if all fields areClone. Thederivedimplementation ofClone callsclone on each field.
For a generic struct,#[derive] implementsClone conditionally by adding boundClone ongeneric parameters.
// `derive` implements Clone for Reading<T> when T is Clone.#[derive(Clone)]structReading<T> { frequency: T,}§How can I implementClone?
Types that areCopy should have a trivial implementation ofClone. More formally:ifT: Copy,x: T, andy: &T, thenlet x = y.clone(); is equivalent tolet x = *y;.Manual implementations should be careful to uphold this invariant; however, unsafe codemust not rely on it to ensure memory safety.
An example is a generic struct holding a function pointer. In this case, theimplementation ofClone cannot bederived, but can be implemented as:
structGenerate<T>(fn() -> T);impl<T> CopyforGenerate<T> {}impl<T> CloneforGenerate<T> {fnclone(&self) ->Self{*self}}If wederive:
the auto-derived implementations will have unnecessaryT: Copy andT: Clone bounds:
// Automatically derivedimpl<T: Copy> CopyforGenerate<T> { }// Automatically derivedimpl<T: Clone> CloneforGenerate<T> {fnclone(&self) -> Generate<T> { Generate(Clone::clone(&self.0)) }}The bounds are unnecessary because clearly the function itself should becopy- and cloneable even if its return type is not:
#[derive(Copy, Clone)]structGenerate<T>(fn() -> T);structNotCloneable;fngenerate_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.§Clone andPartialEq/Eq
Clone is intended for the duplication of objects. Consequently, when implementingbothClone andPartialEq, the following property is expected to hold:
x == x -> x.clone() == xIn other words, if an object compares equal to itself,its clone must also compare equal to the original.
For types that also implementEq – for whichx == x always holds –this implies thatx.clone() == x must always be true.Standard library collections such asHashMap,HashSet,BTreeMap,BTreeSet andBinaryHeaprely on their keys respecting this property for correct behavior.Furthermore, these collections require that cloning a key preserves the outcome of theHash andOrd methods. Thankfully, this follows automatically fromx.clone() == xifHash andOrd are correctly implemented according to their own requirements.
When deriving bothClone andPartialEq using#[derive(Clone, PartialEq)]or when additionally derivingEq using#[derive(Clone, PartialEq, Eq)],then this property is automatically upheld – provided that it is satisfied bythe underlying types.
Violating this property is a logic error. The behavior resulting from a logic error is notspecified, but users of the trait must ensure that such logic errors donot result inundefined behavior. This means thatunsafe codemust not rely on this propertybeing satisfied.
§Additional implementors
In addition to theimplementors listed below,the following types also implementClone:
- 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 environmentor if all such captured values implement
Clonethemselves.Note that variables captured by shared reference always implementClone(even if the referent doesn’t),while variables captured by mutable reference never implementClone.
Required Methods§
1.0.0 ·Sourcefnclone(&self) -> Self
fnclone(&self) -> Self
Returns a duplicate of the value.
Note that what “duplicate” means varies by type:
- For most types, this creates a deep, independent copy
- For reference types like
&T, this creates another reference to the same value - For smart pointers like
ArcorRc, this increments the reference countbut still points to the same underlying data
§Examples
Example with a reference-counted type:
usestd::sync::{Arc, Mutex};letdata = Arc::new(Mutex::new(vec![1,2,3]));letdata_clone = data.clone();// Creates another Arc pointing to the same Mutex{letmutlock = data.lock().unwrap(); lock.push(4);}// Changes are visible through the clone because they share the same underlying dataassert_eq!(*data_clone.lock().unwrap(),vec![1,2,3,4]);Provided Methods§
1.0.0 ·Sourcefnclone_from(&mut self, source: &Self)where Self:,
fnclone_from(&mut self, source: &Self)where Self:,
Performs copy-assignment fromsource.
a.clone_from(&b) is equivalent toa = b.clone() in functionality,but can be overridden to reuse the resources ofa to avoid unnecessaryallocations.
Dyn Compatibility§
This trait isnotdyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
implClone forAsciiChar
implClone for core::cmp::Ordering
implClone forInfallible
implClone forFromBytesWithNulError
implClone for core::fmt::Alignment
implClone forDebugAsHex
implClone forSign
implClone forIpAddr
implClone forIpv6MulticastScope
implClone forSocketAddr
implClone forFpCategory
implClone forIntErrorKind
implClone forGetDisjointMutError
implClone forSearchStep
implClone for core::sync::atomic::Ordering
implClone forbool
implClone forchar
implClone forf16
implClone forf32
implClone forf64
implClone forf128
implClone fori8
implClone fori16
implClone fori32
implClone fori64
implClone fori128
implClone forisize
implClone for!
implClone foru8
implClone foru16
implClone foru32
implClone foru64
implClone foru128
implClone forusize
implClone forAllocError
implClone forLayout
implClone forLayoutError
implClone forTypeId
implClone forfloat64x1_t
target_arch=arm64ec only.implClone forfloat64x1x2_t
target_arch=arm64ec only.implClone forfloat64x1x3_t
target_arch=arm64ec only.implClone forfloat64x1x4_t
target_arch=arm64ec only.implClone forfloat64x2_t
target_arch=arm64ec only.implClone forfloat64x2x2_t
target_arch=arm64ec only.implClone forfloat64x2x3_t
target_arch=arm64ec only.implClone forfloat64x2x4_t
target_arch=arm64ec only.implClone forfloat16x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat16x4x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat16x4x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat16x4x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat16x8_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat16x8x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat16x8x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat16x8x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat32x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat32x2x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat32x2x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat32x2x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat32x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat32x4x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat32x4x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forfloat32x4x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint8x8_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint8x8x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint8x8x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint8x8x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint8x16_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint8x16x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint8x16x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint8x16x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint16x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint16x4x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint16x4x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint16x4x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint16x8_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint16x8x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint16x8x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint16x8x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint32x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint32x2x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint32x2x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint32x2x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint32x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint32x4x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint32x4x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint32x4x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint64x1_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint64x1x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint64x1x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint64x1x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint64x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint64x2x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint64x2x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forint64x2x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly8x8_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly8x8x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly8x8x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly8x8x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly8x16_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly8x16x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly8x16x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly8x16x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly16x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly16x4x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly16x4x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly16x4x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly16x8_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly16x8x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly16x8x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly16x8x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly64x1_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly64x1x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly64x1x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly64x1x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly64x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly64x2x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly64x2x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone forpoly64x2x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint8x8_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint8x8x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint8x8x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint8x8x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint8x16_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint8x16x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint8x16x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint8x16x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint16x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint16x4x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint16x4x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint16x4x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint16x8_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint16x8x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint16x8x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint16x8x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint32x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint32x2x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint32x2x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint32x2x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint32x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint32x4x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint32x4x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint32x4x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint64x1_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint64x1x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint64x1x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint64x1x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint64x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint64x2x2_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint64x2x3_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone foruint64x2x4_t
target_arch=arm64ec or target featurev7) and (ARM or AArch64 ortarget_arch=arm64ec) only.implClone form128
implClone form128d
implClone form128i
implClone form256
implClone form256d
implClone form256i
implClone forf16x2
target_arch=nvptx64 only.implClone for core::arch::powerpc::vector_bool_char
implClone for core::arch::powerpc::vector_bool_int
implClone forvector_bool_long
implClone for core::arch::powerpc::vector_bool_short
implClone for core::arch::powerpc::vector_double
implClone for core::arch::powerpc::vector_float
implClone for core::arch::powerpc::vector_signed_char
implClone for core::arch::powerpc::vector_signed_int
implClone forvector_signed_long
implClone for core::arch::powerpc::vector_signed_short
implClone for core::arch::powerpc::vector_unsigned_char
implClone for core::arch::powerpc::vector_unsigned_int
implClone forvector_unsigned_long
implClone for core::arch::powerpc::vector_unsigned_short
implClone for core::arch::s390x::vector_bool_char
implClone for core::arch::s390x::vector_bool_int
implClone forvector_bool_long_long
implClone for core::arch::s390x::vector_bool_short
implClone for core::arch::s390x::vector_double
implClone for core::arch::s390x::vector_float
implClone for core::arch::s390x::vector_signed_char
implClone for core::arch::s390x::vector_signed_int
implClone forvector_signed_long_long
implClone for core::arch::s390x::vector_signed_short
implClone for core::arch::s390x::vector_unsigned_char
implClone for core::arch::s390x::vector_unsigned_int
implClone forvector_unsigned_long_long
implClone for core::arch::s390x::vector_unsigned_short
implClone forv128
target_family=wasm only.implClone forCpuidResult
implClone for__m128
implClone for__m128bh
implClone for__m128d
implClone for__m128h
implClone for__m128i
implClone for__m256
implClone for__m256bh
implClone for__m256d
implClone for__m256h
implClone for__m256i
implClone for__m512
implClone for__m512bh
implClone for__m512d
implClone for__m512h
implClone for__m512i
implClone forbf16
implClone forTryFromSliceError
implClone for core::ascii::EscapeDefault
implClone forCharTryFromError
implClone forDecodeUtf16Error
implClone for core::char::EscapeDebug
implClone for core::char::EscapeDefault
implClone for core::char::EscapeUnicode
implClone forParseCharError
implClone forToLowercase
implClone forToUppercase
implClone forTryFromCharError
implClone forFromBytesUntilNulError
implClone forError
implClone forFormattingOptions
implClone forSipHasher
implClone forPhantomPinned
implClone forAssume
implClone forAddrParseError
implClone forIpv4Addr
implClone forIpv6Addr
implClone forSocketAddrV4
implClone forSocketAddrV6
implClone forParseFloatError
implClone forParseIntError
implClone forTryFromIntError
implClone forRangeFull
implClone for core::ptr::Alignment
implClone forParseBoolError
implClone forUtf8Error
implClone forLocalWaker
implClone forRawWakerVTable
implClone forWaker
implClone forDuration
implClone forTryFromFloatSecsError
impl<'a>Clone forUtf8Pattern<'a>
impl<'a>Clone forSource<'a>
impl<'a>Clone for core::ffi::c_str::Bytes<'a>
impl<'a>Clone forArguments<'a>
impl<'a>Clone forPhantomContravariantLifetime<'a>
impl<'a>Clone forPhantomCovariantLifetime<'a>
impl<'a>Clone forPhantomInvariantLifetime<'a>
impl<'a>Clone forLocation<'a>
impl<'a>Clone forEscapeAscii<'a>
impl<'a>Clone forCharSearcher<'a>
impl<'a>Clone for core::str::Bytes<'a>
impl<'a>Clone forCharIndices<'a>
impl<'a>Clone forChars<'a>
impl<'a>Clone forEncodeUtf16<'a>
impl<'a>Clone for core::str::EscapeDebug<'a>
impl<'a>Clone for core::str::EscapeDefault<'a>
impl<'a>Clone for core::str::EscapeUnicode<'a>
impl<'a>Clone forLines<'a>
impl<'a>Clone forLinesAny<'a>
impl<'a>Clone forSplitAsciiWhitespace<'a>
impl<'a>Clone forSplitWhitespace<'a>
impl<'a>Clone forUtf8Chunk<'a>
impl<'a>Clone forUtf8Chunks<'a>
impl<'a, 'b>Clone forCharSliceSearcher<'a, 'b>
impl<'a, 'b>Clone forStrSearcher<'a, 'b>
impl<'a, 'b, const N:usize>Clone forCharArrayRefSearcher<'a, 'b, N>
impl<'a, F>Clone forCharPredicateSearcher<'a, F>
impl<'a, P>Clone forMatchIndices<'a, P>
impl<'a, P>Clone forMatches<'a, P>
impl<'a, P>Clone forRMatchIndices<'a, P>
impl<'a, P>Clone forRMatches<'a, P>
impl<'a, P>Clone for core::str::RSplit<'a, P>
impl<'a, P>Clone forRSplitN<'a, P>
impl<'a, P>Clone forRSplitTerminator<'a, P>
impl<'a, P>Clone for core::str::Split<'a, P>
impl<'a, P>Clone forSplitN<'a, P>
impl<'a, P>Clone forSplitTerminator<'a, P>
impl<'a, P:Pattern<Searcher<'a>:Clone>>Clone for core::str::SplitInclusive<'a, P>
impl<'a, T>Clone forRChunksExact<'a, T>
impl<'a, T: 'a, P:Clone>Clone forChunkBy<'a, T, P>
impl<'a, T:Clone + 'a, const N:usize>Clone forArrayWindows<'a, T, N>
impl<'a, const N:usize>Clone forCharArraySearcher<'a, N>
impl<'f>Clone forVaListImpl<'f>
impl<A>Clone for core::option::Iter<'_, A>
impl<A:Clone>Clone forRepeat<A>
impl<A:Clone>Clone forRepeatN<A>
impl<A:Clone>Clone for core::option::IntoIter<A>
impl<A:Clone>Clone forIterRange<A>
impl<A:Clone>Clone forIterRangeFrom<A>
impl<A:Clone>Clone forIterRangeInclusive<A>
impl<A:Clone, B:Clone>Clone forChain<A, B>
impl<A:Clone, B:Clone>Clone forZip<A, B>
impl<B:Clone, C:Clone>Clone forControlFlow<B, C>
impl<Dyn:PointeeSized>Clone forDynMetadata<Dyn>
impl<F:Clone>Clone forFromFn<F>
impl<F:Clone>Clone forOnceWith<F>
impl<F:Clone>Clone forRepeatWith<F>
impl<G:Clone>Clone forFromCoroutine<G>
impl<H>Clone forBuildHasherDefault<H>
impl<I>Clone forDecodeUtf16<I>
impl<I, F, const N:usize>Clone forMapWindows<I, F, N>
impl<I, G>Clone forIntersperseWith<I, G>
impl<I, U>Clone forFlatten<I>
impl<I:Clone +Iterator>Clone forIntersperse<I>
impl<I:Clone +Iterator>Clone forPeekable<I>
impl<I:Clone +Iterator, const N:usize>Clone forArrayChunks<I, N>
impl<I:Clone>Clone forFromIter<I>
impl<I:Clone>Clone forCloned<I>
impl<I:Clone>Clone forCopied<I>
impl<I:Clone>Clone forCycle<I>
impl<I:Clone>Clone forEnumerate<I>
impl<I:Clone>Clone forFuse<I>
impl<I:Clone>Clone forSkip<I>
impl<I:Clone>Clone forStepBy<I>
impl<I:Clone>Clone forTake<I>
impl<I:Clone, F:Clone>Clone forFilterMap<I, F>
impl<I:Clone, F:Clone>Clone forInspect<I, F>
impl<I:Clone, F:Clone>Clone forMap<I, F>
impl<I:Clone, P:Clone>Clone forFilter<I, P>
impl<I:Clone, P:Clone>Clone forMapWhile<I, P>
impl<I:Clone, P:Clone>Clone forSkipWhile<I, P>
impl<I:Clone, P:Clone>Clone forTakeWhile<I, P>
impl<I:Clone, St:Clone, F:Clone>Clone forScan<I, St, F>
impl<I:Clone, U, F:Clone>Clone forFlatMap<I, U, F>
impl<Idx:Clone>Clone for core::ops::Range<Idx>
impl<Idx:Clone>Clone for core::ops::RangeFrom<Idx>
impl<Idx:Clone>Clone for core::ops::RangeInclusive<Idx>
impl<Idx:Clone>Clone forRangeTo<Idx>
impl<Idx:Clone>Clone for core::ops::RangeToInclusive<Idx>
impl<Idx:Clone>Clone for core::range::Range<Idx>
impl<Idx:Clone>Clone for core::range::RangeFrom<Idx>
impl<Idx:Clone>Clone for core::range::RangeInclusive<Idx>
impl<Idx:Clone>Clone for core::range::RangeToInclusive<Idx>
impl<Ptr:Clone>Clone forPin<Ptr>
impl<T>Clone forOption<T>where T:Clone,
impl<T>Clone forPending<T>
impl<T>Clone forEmpty<T>
impl<T>Clone forPhantomContravariant<T>where T: ?Sized,
impl<T>Clone forPhantomCovariant<T>where T: ?Sized,
impl<T>Clone forPhantomInvariant<T>where T: ?Sized,
impl<T>Clone forDiscriminant<T>
impl<T>Clone forNonZero<T>where T:ZeroablePrimitive,
impl<T>Clone for core::result::Iter<'_, T>
impl<T>Clone forChunks<'_, T>
impl<T>Clone forChunksExact<'_, T>
impl<T>Clone for core::slice::Iter<'_, T>
impl<T>Clone forRChunks<'_, T>
impl<T>Clone forWindows<'_, T>
impl<T>Clone forExclusive<T>
impl<T, E>Clone forResult<T, E>
impl<T, P>Clone for core::slice::RSplit<'_, T, P>
impl<T, P>Clone for core::slice::Split<'_, T, P>
impl<T, P>Clone for core::slice::SplitInclusive<'_, T, P>
impl<T, const N:usize>Clone forMask<T, N>
impl<T, const N:usize>Clone forSimd<T, N>
impl<T:Copy>Clone forCell<T>
impl<T:Copy>Clone forMaybeUninit<T>
impl<T:PointeeSized> !Clone for&mut T
Shared references can be cloned, but mutable referencescannot!
impl<T:PointeeSized>Clone for*const T
impl<T:PointeeSized>Clone for*mut T
impl<T:PointeeSized>Clone for&T
Shared references can be cloned, but mutable referencescannot!