Trait Clone
pub trait Clone: Sized
A common trait that allows explicit creation of a duplicate value.
Calling clone 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.
See Clone::clone for more details.
This distinction is especially important when using #[derive(Clone)] on structs containing
smart pointers like Arc<Mutex<T>> - the cloned struct will share mutable state with the
original.
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. Copy has no methods, so you
cannot change its behavior, but when implementing Clone, the clone method you provide
may run arbitrary code.
Since Clone is a supertrait of Copy, any type that implements Copy must also implement
Clone.
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.
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:
);
If we derive:
);
the auto-derived implementations will have unnecessary T: Copy and T: Clone bounds:
# );
// Automatically derived
// Automatically derived
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.
Clone and PartialEq/Eq
Clone is intended for the duplication of objects. Consequently, when implementing
both Clone and PartialEq, the following property is expected to hold:
x == x -> x.clone() == x
In other words, if an object compares equal to itself, its clone must also compare equal to the original.
For types that also implement Eq – for which x == x always holds –
this implies that x.clone() == x must always be true.
Standard library collections such as
HashMap, HashSet, BTreeMap, BTreeSet and BinaryHeap
rely on their keys respecting this property for correct behavior.
Furthermore, these collections require that cloning a key preserves the outcome of the
Hash and Ord methods. Thankfully, this follows automatically from x.clone() == x
if Hash and Ord are correctly implemented according to their own requirements.
When deriving both Clone and PartialEq using #[derive(Clone, PartialEq)]
or when additionally deriving Eq using #[derive(Clone, PartialEq, Eq)],
then this property is automatically upheld – provided that it is satisfied by
the underlying types.
Violating this property is a logic error. The behavior resulting from a logic error is not
specified, but users of the trait must ensure that such logic errors do not result in
undefined behavior. This means that unsafe code must not rely on this property
being satisfied.
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
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
fn clone(&self) -> SelfReturns 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 count but still points to the same underlying data
Examples
# let hello = "Hello"; // &str implements Clone assert_eq!;Example with a reference-counted type:
use ; let data = new; let data_clone = data.clone; // Creates another Arc pointing to the same Mutex // Changes are visible through the clone because they share the same underlying data assert_eq!;
Provided Methods
fn clone_from(&mut self, source: &Self) where Self: ,Performs copy-assignment from
source.a.clone_from(&b)is equivalent toa = b.clone()in functionality, but can be overridden to reuse the resources ofato avoid unnecessary allocations.
Implementors
impl Clone for AddrKindimpl Clone for AddrParseErrorimpl Clone for Alignmentimpl Clone for Alignmentimpl Clone for AlignmentEnumimpl Clone for AllocErrorimpl Clone for AlwaysEscapedimpl Clone for AsciiCharimpl Clone for Assumeimpl Clone for BiasedFpimpl Clone for Big32x40impl Clone for Big8x3impl Clone for BorrowRef<'_>impl Clone for ByteNeedleimpl Clone for BytesIsNotEmptyimpl Clone for CaseMappingIterimpl Clone for CharCaseimpl Clone for CharErrorKindimpl Clone for CharEscapeDebugimpl Clone for CharEscapeDefaultimpl Clone for CharEscapeUnicodeimpl Clone for CharTryFromErrorimpl Clone for CodePointimpl Clone for CodePointInnerimpl Clone for CpuidResultimpl Clone for DebugAsHeximpl Clone for Decimalimpl Clone for DecimalSeqimpl Clone for DecodeUtf16Errorimpl Clone for Decodedimpl Clone for DriftsortRunimpl Clone for Durationimpl Clone for Emptyimpl Clone for EmptyNeedleimpl Clone for Errorimpl Clone for ErrorKindimpl Clone for EscapeByteimpl Clone for EscapeDebugimpl Clone for EscapeDefaultimpl Clone for EscapeDefaultimpl Clone for EscapeUnicodeimpl Clone for FieldIdimpl Clone for FloatErrorKindimpl Clone for FormattingOptionsimpl Clone for Fpimpl Clone for FpCategoryimpl Clone for FromBytesUntilNulErrorimpl Clone for FromBytesWithNulErrorimpl Clone for FullDecodedimpl Clone for GetDisjointMutErrorimpl Clone for HvxVectorimpl Clone for HvxVectorimpl Clone for HvxVectorPairimpl Clone for HvxVectorPairimpl Clone for HvxVectorPredimpl Clone for HvxVectorPredimpl Clone for I32NotAllOnesimpl Clone for I64NotAllOnesimpl Clone for IndexRangeimpl Clone for IntErrorKindimpl Clone for IpAddrimpl Clone for Ipv4Addrimpl Clone for Ipv6Addrimpl Clone for Ipv6MulticastScopeimpl Clone for IsAsciiWhitespaceimpl Clone for IsNotEmptyimpl Clone for IsWhitespaceimpl Clone for Layoutimpl Clone for LayoutErrorimpl Clone for LinesMapimpl Clone for LocalWakerimpl Clone for Localityimpl Clone for MaybeEscapedimpl Clone for Nanosecondsimpl Clone for NonZeroCharInnerimpl Clone for NonZeroI128Innerimpl Clone for NonZeroI16Innerimpl Clone for NonZeroI32Innerimpl Clone for NonZeroI64Innerimpl Clone for NonZeroI8Innerimpl Clone for NonZeroIsizeInnerimpl Clone for NonZeroU128Innerimpl Clone for NonZeroU16Innerimpl Clone for NonZeroU32Innerimpl Clone for NonZeroU64Innerimpl Clone for NonZeroU8Innerimpl Clone for NonZeroUsizeInnerimpl Clone for Orderingimpl Clone for Orderingimpl Clone for ParseBoolErrorimpl Clone for ParseCharErrorimpl Clone for ParseFloatErrorimpl Clone for ParseIntErrorimpl Clone for PhantomPinnedimpl Clone for Rangeimpl Clone for RangeFullimpl Clone for RawWakerVTableimpl Clone for ResumeTyimpl Clone for SearchStepimpl Clone for SeekFromimpl Clone for Signimpl Clone for Signimpl Clone for Sinkimpl Clone for Sip13Roundsimpl Clone for Sip24Roundsimpl Clone for SipHasherimpl Clone for SipHasher13impl Clone for SipHasher24impl Clone for SocketAddrimpl Clone for SocketAddrV4impl Clone for SocketAddrV6impl Clone for Spanimpl Clone for Stateimpl Clone for StrSearcherImplimpl Clone for ToCasefoldimpl Clone for ToLowercaseimpl Clone for ToTitlecaseimpl Clone for ToUppercaseimpl Clone for TryFromCharErrorimpl Clone for TryFromFloatSecsErrorimpl Clone for TryFromFloatSecsErrorKindimpl Clone for TryFromIntErrorimpl Clone for TryFromSliceErrorimpl Clone for TwoWaySearcherimpl Clone for TypeIdimpl Clone for U32NotAllOnesimpl Clone for U64NotAllOnesimpl Clone for UnsafeBytesToStrimpl Clone for UsizeNoHighBitimpl Clone for Utf8Errorimpl Clone for VaListInnerimpl Clone for VariantIdimpl Clone for Wakerimpl Clone for __m128impl Clone for __m128bhimpl Clone for __m128dimpl Clone for __m128himpl Clone for __m128iimpl Clone for __m256impl Clone for __m256bhimpl Clone for __m256dimpl Clone for __m256himpl Clone for __m256iimpl Clone for __m512impl Clone for __m512bhimpl Clone for __m512dimpl Clone for __m512himpl Clone for __m512iimpl Clone for __tile1024iimpl Clone for bf16impl Clone for boolimpl Clone for charimpl Clone for f128impl Clone for f16impl Clone for f16x2impl Clone for f32impl Clone for f64impl Clone for float16x4_timpl Clone for float16x4x2_timpl Clone for float16x4x3_timpl Clone for float16x4x4_timpl Clone for float16x8_timpl Clone for float16x8x2_timpl Clone for float16x8x3_timpl Clone for float16x8x4_timpl Clone for float32x2_timpl Clone for float32x2x2_timpl Clone for float32x2x3_timpl Clone for float32x2x4_timpl Clone for float32x4_timpl Clone for float32x4x2_timpl Clone for float32x4x3_timpl Clone for float32x4x4_timpl Clone for float64x1_timpl Clone for float64x1x2_timpl Clone for float64x1x3_timpl Clone for float64x1x4_timpl Clone for float64x2_timpl Clone for float64x2x2_timpl Clone for float64x2x3_timpl Clone for float64x2x4_timpl Clone for i128impl Clone for i16impl Clone for i32impl Clone for i64impl Clone for i8impl Clone for int16x4_timpl Clone for int16x4x2_timpl Clone for int16x4x3_timpl Clone for int16x4x4_timpl Clone for int16x8_timpl Clone for int16x8x2_timpl Clone for int16x8x3_timpl Clone for int16x8x4_timpl Clone for int32x2_timpl Clone for int32x2x2_timpl Clone for int32x2x3_timpl Clone for int32x2x4_timpl Clone for int32x4_timpl Clone for int32x4x2_timpl Clone for int32x4x3_timpl Clone for int32x4x4_timpl Clone for int64x1_timpl Clone for int64x1x2_timpl Clone for int64x1x3_timpl Clone for int64x1x4_timpl Clone for int64x2_timpl Clone for int64x2x2_timpl Clone for int64x2x3_timpl Clone for int64x2x4_timpl Clone for int8x16_timpl Clone for int8x16x2_timpl Clone for int8x16x3_timpl Clone for int8x16x4_timpl Clone for int8x8_timpl Clone for int8x8x2_timpl Clone for int8x8x3_timpl Clone for int8x8x4_timpl Clone for iovecimpl Clone for isizeimpl Clone for m128impl Clone for m128dimpl Clone for m128iimpl Clone for m256impl Clone for m256dimpl Clone for m256iimpl Clone for neverimpl Clone for nxv2i16impl Clone for nxv2i32impl Clone for nxv2i8impl Clone for nxv2u16impl Clone for nxv2u32impl Clone for nxv2u8impl Clone for nxv4i16impl Clone for nxv4i8impl Clone for nxv4u16impl Clone for nxv4u8impl Clone for nxv8i8impl Clone for nxv8u8impl Clone for poly16x4_timpl Clone for poly16x4x2_timpl Clone for poly16x4x3_timpl Clone for poly16x4x4_timpl Clone for poly16x8_timpl Clone for poly16x8x2_timpl Clone for poly16x8x3_timpl Clone for poly16x8x4_timpl Clone for poly64x1_timpl Clone for poly64x1x2_timpl Clone for poly64x1x3_timpl Clone for poly64x1x4_timpl Clone for poly64x2_timpl Clone for poly64x2x2_timpl Clone for poly64x2x3_timpl Clone for poly64x2x4_timpl Clone for poly8x16_timpl Clone for poly8x16x2_timpl Clone for poly8x16x3_timpl Clone for poly8x16x4_timpl Clone for poly8x8_timpl Clone for poly8x8x2_timpl Clone for poly8x8x3_timpl Clone for poly8x8x4_timpl Clone for svbool2_timpl Clone for svbool4_timpl Clone for svbool8_timpl Clone for svbool_timpl Clone for svfloat32_timpl Clone for svfloat32x2_timpl Clone for svfloat32x3_timpl Clone for svfloat32x4_timpl Clone for svfloat64_timpl Clone for svfloat64x2_timpl Clone for svfloat64x3_timpl Clone for svfloat64x4_timpl Clone for svint16_timpl Clone for svint16x2_timpl Clone for svint16x3_timpl Clone for svint16x4_timpl Clone for svint32_timpl Clone for svint32x2_timpl Clone for svint32x3_timpl Clone for svint32x4_timpl Clone for svint64_timpl Clone for svint64x2_timpl Clone for svint64x3_timpl Clone for svint64x4_timpl Clone for svint8_timpl Clone for svint8x2_timpl Clone for svint8x3_timpl Clone for svint8x4_timpl Clone for svpatternimpl Clone for svprfopimpl Clone for svuint16_timpl Clone for svuint16x2_timpl Clone for svuint16x3_timpl Clone for svuint16x4_timpl Clone for svuint32_timpl Clone for svuint32x2_timpl Clone for svuint32x3_timpl Clone for svuint32x4_timpl Clone for svuint64_timpl Clone for svuint64x2_timpl Clone for svuint64x3_timpl Clone for svuint64x4_timpl Clone for svuint8_timpl Clone for svuint8x2_timpl Clone for svuint8x3_timpl Clone for svuint8x4_timpl Clone for u128impl Clone for u16impl Clone for u32impl Clone for u64impl Clone for u8impl Clone for uint16x4_timpl Clone for uint16x4x2_timpl Clone for uint16x4x3_timpl Clone for uint16x4x4_timpl Clone for uint16x8_timpl Clone for uint16x8x2_timpl Clone for uint16x8x3_timpl Clone for uint16x8x4_timpl Clone for uint32x2_timpl Clone for uint32x2x2_timpl Clone for uint32x2x3_timpl Clone for uint32x2x4_timpl Clone for uint32x4_timpl Clone for uint32x4x2_timpl Clone for uint32x4x3_timpl Clone for uint32x4x4_timpl Clone for uint64x1_timpl Clone for uint64x1x2_timpl Clone for uint64x1x3_timpl Clone for uint64x1x4_timpl Clone for uint64x2_timpl Clone for uint64x2x2_timpl Clone for uint64x2x3_timpl Clone for uint64x2x4_timpl Clone for uint8x16_timpl Clone for uint8x16x2_timpl Clone for uint8x16x3_timpl Clone for uint8x16x4_timpl Clone for uint8x8_timpl Clone for uint8x8x2_timpl Clone for uint8x8x3_timpl Clone for uint8x8x4_timpl Clone for usizeimpl Clone for v128impl Clone for vector_bool_charimpl Clone for vector_bool_charimpl Clone for vector_bool_intimpl Clone for vector_bool_intimpl Clone for vector_bool_longimpl Clone for vector_bool_long_longimpl Clone for vector_bool_shortimpl Clone for vector_bool_shortimpl Clone for vector_doubleimpl Clone for vector_doubleimpl Clone for vector_floatimpl Clone for vector_floatimpl Clone for vector_signed_charimpl Clone for vector_signed_charimpl Clone for vector_signed_intimpl Clone for vector_signed_intimpl Clone for vector_signed_longimpl Clone for vector_signed_long_longimpl Clone for vector_signed_shortimpl Clone for vector_signed_shortimpl Clone for vector_unsigned_charimpl Clone for vector_unsigned_charimpl Clone for vector_unsigned_intimpl Clone for vector_unsigned_intimpl Clone for vector_unsigned_longimpl Clone for vector_unsigned_long_longimpl Clone for vector_unsigned_shortimpl Clone for vector_unsigned_shortimpl<'a> Clone for Argument<'a>impl<'a> Clone for ArgumentType<'a>impl<'a> Clone for Arguments<'a>impl<'a> Clone for Bytes<'a>impl<'a> Clone for Bytes<'a>impl<'a> Clone for CharIndices<'a>impl<'a> Clone for CharSearcher<'a>impl<'a> Clone for Chars<'a>impl<'a> Clone for EncodeUtf16<'a>impl<'a> Clone for EncodeWide<'a>impl<'a> Clone for EscapeAscii<'a>impl<'a> Clone for EscapeDebug<'a>impl<'a> Clone for EscapeDefault<'a>impl<'a> Clone for EscapeUnicode<'a>impl<'a> Clone for Formatted<'a>impl<'a> Clone for IoSlice<'a>impl<'a> Clone for IoSlice<'a>impl<'a> Clone for Lines<'a>impl<'a> Clone for LinesAny<'a>impl<'a> Clone for Location<'a>impl<'a> Clone for Part<'a>impl<'a> Clone for PhantomContravariantLifetime<'a>impl<'a> Clone for PhantomCovariantLifetime<'a>impl<'a> Clone for PhantomInvariantLifetime<'a>impl<'a> Clone for Source<'a>impl<'a> Clone for SplitAsciiWhitespace<'a>impl<'a> Clone for SplitAsciiWhitespace<'a>impl<'a> Clone for SplitWhitespace<'a>impl<'a> Clone for Utf8Chunk<'a>impl<'a> Clone for Utf8Chunks<'a>impl<'a> Clone for Utf8Pattern<'a>impl<'a> Clone for Wtf8CodePoints<'a>impl<'a, 'b> Clone for CharSliceSearcher<'a, 'b>impl<'a, 'b> Clone for StrSearcher<'a, 'b>impl<'a, 'b, const N: usize> Clone for CharArrayRefSearcher<'a, 'b, N>impl<'a, C: Clone + MultiCharEq> Clone for MultiCharEqSearcher<'a, C>impl<'a, F> Clone for CharPredicateSearcher<'a, F> where F: FnMut(char) -> bool + Clone,impl<'a, P> Clone for MatchIndices<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for MatchIndicesInternal<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for Matches<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for MatchesInternal<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for RMatchIndices<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for RMatches<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for RSplit<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for RSplitN<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for RSplitTerminator<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for Split<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for SplitInternal<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for SplitN<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for SplitNInternal<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P> Clone for SplitTerminator<'a, P> where P: Pattern<Searcher<'a>: Clone>,impl<'a, P: Pattern<Searcher<'a>: Clone>> Clone for SplitInclusive<'a, P>impl<'a, T> Clone for RChunksExact<'a, T>impl<'a, T: 'a, P: Clone> Clone for ChunkBy<'a, T, P>impl<'a, const N: usize> Clone for CharArraySearcher<'a, N>impl<'f> Clone for VaList<'f>impl<A> Clone for Iter<'_, A>impl<A: Clone> Clone for IntoIter<A>impl<A: Clone> Clone for Item<A>impl<A: Clone> Clone for OptionFlatten<A>impl<A: Clone> Clone for RangeFromIter<A>impl<A: Clone> Clone for RangeInclusiveIter<A>impl<A: Clone> Clone for RangeIter<A>impl<A: Clone> Clone for Repeat<A>impl<A: Clone> Clone for RepeatN<A>impl<A: Clone, B: Clone> Clone for Chain<A, B>impl<A: Clone, B: Clone> Clone for Zip<A, B>impl<B: ~const Clone, C: ~const Clone> Clone for ControlFlow<B, C>impl<Dyn: PointeeSized> Clone for DynMetadata<Dyn>impl<F: Clone> Clone for FromFn<F>impl<F: Clone> Clone for OnceWith<F>impl<F: Clone> Clone for RepeatWith<F>impl<G: Clone> Clone for FromCoroutine<G>impl<H> Clone for BuildHasherDefault<H>impl<I> Clone for DecodeUtf16<I> where I: Iterator<Item = u16> + Clone,impl<I, F, const N: usize> Clone for MapWindows<I, F, N> where I: Iterator + Clone, F: Clone, I::Item: Clone,impl<I, G> Clone for IntersperseWith<I, G> where I: Iterator + Clone, I::Item: Clone, G: Clone,impl<I, U> Clone for Flatten<I> where I: Clone + Iterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>, U: Clone + Iterator,impl<I, const N: usize> Clone for MapWindowsInner<I, N> where I: Iterator + Clone, I::Item: Clone,impl<I: Clone + Iterator> Clone for Intersperse<I> where I::Item: Clone + Clone,impl<I: Clone + Iterator> Clone for Peekable<I> where I::Item: Clone,impl<I: Clone + Iterator, const N: usize> Clone for ArrayChunks<I, N> where I::Item: Clone,impl<I: Clone> Clone for Cloned<I>impl<I: Clone> Clone for Copied<I>impl<I: Clone> Clone for Cycle<I>impl<I: Clone> Clone for Enumerate<I>impl<I: Clone> Clone for FromIter<I>impl<I: Clone> Clone for Fuse<I>impl<I: Clone> Clone for Skip<I>impl<I: Clone> Clone for StepBy<I>impl<I: Clone> Clone for Take<I>impl<I: Clone, F: Clone> Clone for FilterMap<I, F>impl<I: Clone, F: Clone> Clone for Inspect<I, F>impl<I: Clone, F: Clone> Clone for Map<I, F>impl<I: Clone, P: Clone> Clone for Filter<I, P>impl<I: Clone, P: Clone> Clone for MapWhile<I, P>impl<I: Clone, P: Clone> Clone for SkipWhile<I, P>impl<I: Clone, P: Clone> Clone for TakeWhile<I, P>impl<I: Clone, St: Clone, F: Clone> Clone for Scan<I, St, F>impl<I: Clone, U, F: Clone> Clone for FlatMap<I, U, F> where U: Clone + IntoIterator<IntoIter: Clone>,impl<I: Clone, U: Clone> Clone for FlattenCompat<I, U>impl<Idx: Clone> Clone for RangeInclusive<Idx>impl<Idx: Clone> Clone for RangeInclusive<Idx>impl<Idx: Clone> Clone for RangeToInclusive<Idx>impl<Idx: Clone> Clone for RangeToInclusive<Idx>impl<Idx: ~const Clone> Clone for Range<Idx>impl<Idx: ~const Clone> Clone for Range<Idx>impl<Idx: ~const Clone> Clone for RangeFrom<Idx>impl<Idx: ~const Clone> Clone for RangeFrom<Idx>impl<Idx: ~const Clone> Clone for RangeTo<Idx>impl<K: Clone, V: Clone> Clone for KeyAndValue<K, V>impl<P: Clone + ?Sized> Clone for MaybeDangling<P>impl<Ptr: Clone> Clone for Pin<Ptr>impl<S: Sip> Clone for Hasher<S>impl<T> Clone for Chunks<'_, T>impl<T> Clone for ChunksExact<'_, T>impl<T> Clone for Cursor<T> where T: Clone,impl<T> Clone for Discriminant<T>impl<T> Clone for Empty<T>impl<T> Clone for Iter<'_, T>impl<T> Clone for Iter<'_, T>impl<T> Clone for NonZero<T> where T: ZeroablePrimitive,impl<T> Clone for Option<T> where T: ~const Clone,impl<T> Clone for Pending<T>impl<T> Clone for PhantomContravariant<T> where T: ?Sized,impl<T> Clone for PhantomCovariant<T> where T: ?Sized,impl<T> Clone for PhantomInvariant<T> where T: ?Sized,impl<T> Clone for RChunks<'_, T>impl<T> Clone for SyncView<T> where T: Sync + ~const Clone,impl<T> Clone for Windows<'_, T>impl<T, E> Clone for Result<T, E> where T: Clone, E: Clone,impl<T, P> Clone for RSplit<'_, T, P> where P: Clone + FnMut(&T) -> bool,impl<T, P> Clone for Split<'_, T, P> where P: Clone + FnMut(&T) -> bool,impl<T, P> Clone for SplitInclusive<'_, T, P> where P: Clone + FnMut(&T) -> bool,impl<T, const N: usize> Clone for ArrayWindows<'_, T, N>impl<T, const N: usize> Clone for Mask<T, N> where T: MaskElement,impl<T, const N: usize> Clone for Simd<T, N> where T: SimdElement,impl<T: ?Sized, const VARIANT: u32, const FIELD: u32> Clone for FieldRepresentingType<T, VARIANT, FIELD>impl<T: Clone + ?Sized> Clone for ManuallyDrop<T>impl<T: Clone> Clone for Complex<T>impl<T: Clone> Clone for IntoIter<T>impl<T: Clone> Clone for Once<T>impl<T: Clone> Clone for OnceCell<T>impl<T: Clone> Clone for Poll<T>impl<T: Clone> Clone for Ready<T>impl<T: Clone> Clone for RefCell<T>impl<T: Clone> Clone for RepeatNInner<T>impl<T: Clone> Clone for Rev<T>impl<T: Clone> Clone for Reverse<T>impl<T: Clone> Clone for Saturating<T>impl<T: Clone> Clone for Wrapping<T>impl<T: Clone, F: Clone> Clone for Successors<T, F>impl<T: Clone, const N: usize> Clone for Buffer<T, N>impl<T: Clone, const N: usize> Clone for IntoIter<T, N>impl<T: Clone, const N: usize> Clone for PolymorphicIter<[MaybeUninit<T>; N]>impl<T: Clone, const N: usize> Clone for [T; N]impl<T: Copy> Clone for Cell<T>impl<T: Copy> Clone for MaybeUninit<T>impl<T: PointeeSized> !Clone for &mut Timpl<T: PointeeSized> Clone for &Timpl<T: PointeeSized> Clone for *const Timpl<T: PointeeSized> Clone for *mut Timpl<T: PointeeSized> Clone for NonNull<T>impl<T: PointeeSized> Clone for PhantomData<T>impl<T: PointeeSized> Clone for Unique<T>impl<T: SimdElement, const N: usize> Clone for Simd<T, N>impl<T: SimdElement, const N: usize> Clone for SimdM<T, N>impl<T: ~const Clone> Clone for Bound<T>impl<Y: Clone, R: Clone> Clone for CoroutineState<Y, R>impl<const N: usize> Clone for MaybeEscapedCharacter<N>impl<const N: usize, ESCAPING: Clone> Clone for EscapeIterInner<N, ESCAPING>