pub trait Clone: Sized {
// Required method
fn clone(&self) -> Self;
// Provided method
fn clone_from(&mut self, source: &Self)
where Self: { ... }
}Expand description
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. 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:
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.§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() == xIn 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§
1.0.0 · Sourcefn clone(&self) -> Self
fn clone(&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 count but still points to the same underlying data
§Examples
Example with a reference-counted type:
use std::sync::{Arc, Mutex};
let data = Arc::new(Mutex::new(vec![1, 2, 3]));
let data_clone = data.clone(); // Creates another Arc pointing to the same Mutex
{
let mut lock = data.lock().unwrap();
lock.push(4);
}
// Changes are visible through the clone because they share the same underlying data
assert_eq!(*data_clone.lock().unwrap(), vec![1, 2, 3, 4]);Provided Methods§
1.0.0 · Sourcefn clone_from(&mut self, source: &Self)where
Self:,
fn clone_from(&mut self, source: &Self)where
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§
impl Clone for AsciiChar
ferrocene_certified only.impl Clone for core::cmp::Ordering
impl Clone for Infallible
impl Clone for FromBytesWithNulError
ferrocene_certified only.impl Clone for core::fmt::Alignment
impl Clone for DebugAsHex
impl Clone for Sign
impl Clone for IpAddr
ferrocene_certified only.impl Clone for Ipv6MulticastScope
ferrocene_certified only.impl Clone for SocketAddr
ferrocene_certified only.impl Clone for FpCategory
impl Clone for IntErrorKind
impl Clone for GetDisjointMutError
impl Clone for SearchStep
ferrocene_certified only.impl Clone for core::sync::atomic::Ordering
impl Clone for bool
impl Clone for char
impl Clone for f16
impl Clone for f32
impl Clone for f64
impl Clone for f128
impl Clone for i8
impl Clone for i16
impl Clone for i32
impl Clone for i64
impl Clone for i128
impl Clone for isize
impl Clone for !
impl Clone for u8
impl Clone for u16
impl Clone for u32
impl Clone for u64
impl Clone for u128
impl Clone for usize
impl Clone for AllocError
impl Clone for Layout
impl Clone for LayoutError
impl Clone for TypeId
impl Clone for float64x1_t
target_arch=arm64ec only.impl Clone for float64x1x2_t
target_arch=arm64ec only.impl Clone for float64x1x3_t
target_arch=arm64ec only.impl Clone for float64x1x4_t
target_arch=arm64ec only.impl Clone for float64x2_t
target_arch=arm64ec only.impl Clone for float64x2x2_t
target_arch=arm64ec only.impl Clone for float64x2x3_t
target_arch=arm64ec only.impl Clone for float64x2x4_t
target_arch=arm64ec only.impl Clone for float16x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float16x4x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float16x4x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float16x4x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float16x8_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float16x8x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float16x8x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float16x8x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float32x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float32x2x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float32x2x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float32x2x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float32x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float32x4x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float32x4x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for float32x4x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int8x8_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int8x8x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int8x8x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int8x8x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int8x16_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int8x16x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int8x16x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int8x16x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int16x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int16x4x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int16x4x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int16x4x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int16x8_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int16x8x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int16x8x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int16x8x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int32x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int32x2x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int32x2x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int32x2x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int32x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int32x4x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int32x4x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int32x4x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int64x1_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int64x1x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int64x1x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int64x1x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int64x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int64x2x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int64x2x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for int64x2x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly8x8_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly8x8x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly8x8x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly8x8x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly8x16_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly8x16x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly8x16x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly8x16x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly16x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly16x4x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly16x4x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly16x4x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly16x8_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly16x8x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly16x8x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly16x8x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly64x1_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly64x1x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly64x1x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly64x1x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly64x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly64x2x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly64x2x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for poly64x2x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint8x8_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint8x8x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint8x8x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint8x8x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint8x16_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint8x16x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint8x16x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint8x16x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint16x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint16x4x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint16x4x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint16x4x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint16x8_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint16x8x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint16x8x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint16x8x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint32x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint32x2x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint32x2x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint32x2x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint32x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint32x4x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint32x4x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint32x4x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint64x1_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint64x1x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint64x1x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint64x1x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint64x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint64x2x2_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint64x2x3_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for uint64x2x4_t
target_arch=arm64ec or target feature v7) and (ARM or AArch64 or target_arch=arm64ec) and non-crate feature ferrocene_certified only.impl Clone for m128
impl Clone for m128d
impl Clone for m128i
impl Clone for m256
impl Clone for m256d
impl Clone for m256i
impl Clone for f16x2
target_arch=nvptx64 only.impl Clone for core::arch::powerpc::vector_bool_char
impl Clone for core::arch::powerpc::vector_bool_int
impl Clone for vector_bool_long
impl Clone for core::arch::powerpc::vector_bool_short
impl Clone for core::arch::powerpc::vector_double
impl Clone for core::arch::powerpc::vector_float
impl Clone for core::arch::powerpc::vector_signed_char
impl Clone for core::arch::powerpc::vector_signed_int
impl Clone for vector_signed_long
impl Clone for core::arch::powerpc::vector_signed_short
impl Clone for core::arch::powerpc::vector_unsigned_char
impl Clone for core::arch::powerpc::vector_unsigned_int
impl Clone for vector_unsigned_long
impl Clone for core::arch::powerpc::vector_unsigned_short
impl Clone for core::arch::s390x::vector_bool_char
impl Clone for core::arch::s390x::vector_bool_int
impl Clone for vector_bool_long_long
impl Clone for core::arch::s390x::vector_bool_short
impl Clone for core::arch::s390x::vector_double
impl Clone for core::arch::s390x::vector_float
impl Clone for core::arch::s390x::vector_signed_char
impl Clone for core::arch::s390x::vector_signed_int
impl Clone for vector_signed_long_long
impl Clone for core::arch::s390x::vector_signed_short
impl Clone for core::arch::s390x::vector_unsigned_char
impl Clone for core::arch::s390x::vector_unsigned_int
impl Clone for vector_unsigned_long_long
impl Clone for core::arch::s390x::vector_unsigned_short
impl Clone for v128
target_family=wasm only.impl Clone for CpuidResult
impl Clone for __m128
impl Clone for __m128bh
impl Clone for __m128d
impl Clone for __m128h
impl Clone for __m128i
impl Clone for __m256
impl Clone for __m256bh
impl Clone for __m256d
impl Clone for __m256h
impl Clone for __m256i
impl Clone for __m512
impl Clone for __m512bh
impl Clone for __m512d
impl Clone for __m512h
impl Clone for __m512i
impl Clone for bf16
impl Clone for TryFromSliceError
impl Clone for core::ascii::EscapeDefault
ferrocene_certified only.impl Clone for CharTryFromError
ferrocene_certified only.impl Clone for DecodeUtf16Error
ferrocene_certified only.impl Clone for core::char::EscapeDebug
ferrocene_certified only.impl Clone for core::char::EscapeDefault
ferrocene_certified only.impl Clone for core::char::EscapeUnicode
ferrocene_certified only.impl Clone for ParseCharError
ferrocene_certified only.impl Clone for ToLowercase
ferrocene_certified only.impl Clone for ToUppercase
ferrocene_certified only.impl Clone for TryFromCharError
ferrocene_certified only.impl Clone for FromBytesUntilNulError
ferrocene_certified only.impl Clone for Error
impl Clone for FormattingOptions
impl Clone for SipHasher
ferrocene_certified only.impl Clone for PhantomPinned
impl Clone for Assume
ferrocene_certified only.impl Clone for AddrParseError
ferrocene_certified only.impl Clone for Ipv4Addr
ferrocene_certified only.impl Clone for Ipv6Addr
ferrocene_certified only.impl Clone for SocketAddrV4
ferrocene_certified only.impl Clone for SocketAddrV6
ferrocene_certified only.impl Clone for ParseFloatError
ferrocene_certified only.impl Clone for ParseIntError
impl Clone for TryFromIntError
impl Clone for RangeFull
impl Clone for core::ptr::Alignment
impl Clone for ParseBoolError
impl Clone for Utf8Error
impl Clone for LocalWaker
ferrocene_certified only.impl Clone for RawWakerVTable
ferrocene_certified only.impl Clone for Waker
ferrocene_certified only.impl Clone for Duration
impl Clone for TryFromFloatSecsError
impl<'a> Clone for Utf8Pattern<'a>
ferrocene_certified only.impl<'a> Clone for Source<'a>
ferrocene_certified only.impl<'a> Clone for core::ffi::c_str::Bytes<'a>
ferrocene_certified only.impl<'a> Clone for Arguments<'a>
impl<'a> Clone for PhantomContravariantLifetime<'a>
ferrocene_certified only.impl<'a> Clone for PhantomCovariantLifetime<'a>
ferrocene_certified only.impl<'a> Clone for PhantomInvariantLifetime<'a>
ferrocene_certified only.impl<'a> Clone for Location<'a>
impl<'a> Clone for EscapeAscii<'a>
ferrocene_certified only.impl<'a> Clone for CharSearcher<'a>
ferrocene_certified only.impl<'a> Clone for core::str::Bytes<'a>
ferrocene_certified only.impl<'a> Clone for CharIndices<'a>
ferrocene_certified only.impl<'a> Clone for Chars<'a>
ferrocene_certified only.impl<'a> Clone for EncodeUtf16<'a>
ferrocene_certified only.impl<'a> Clone for core::str::EscapeDebug<'a>
ferrocene_certified only.impl<'a> Clone for core::str::EscapeDefault<'a>
ferrocene_certified only.impl<'a> Clone for core::str::EscapeUnicode<'a>
ferrocene_certified only.impl<'a> Clone for Lines<'a>
ferrocene_certified only.impl<'a> Clone for LinesAny<'a>
ferrocene_certified only.impl<'a> Clone for SplitAsciiWhitespace<'a>
ferrocene_certified only.impl<'a> Clone for SplitWhitespace<'a>
ferrocene_certified only.impl<'a> Clone for Utf8Chunk<'a>
ferrocene_certified only.impl<'a> Clone for Utf8Chunks<'a>
ferrocene_certified only.impl<'a, 'b> Clone for CharSliceSearcher<'a, 'b>
ferrocene_certified only.impl<'a, 'b> Clone for StrSearcher<'a, 'b>
ferrocene_certified only.impl<'a, 'b, const N: usize> Clone for CharArrayRefSearcher<'a, 'b, N>
ferrocene_certified only.impl<'a, F> Clone for CharPredicateSearcher<'a, F>
ferrocene_certified only.impl<'a, P> Clone for MatchIndices<'a, P>
ferrocene_certified only.impl<'a, P> Clone for Matches<'a, P>
ferrocene_certified only.impl<'a, P> Clone for RMatchIndices<'a, P>
ferrocene_certified only.impl<'a, P> Clone for RMatches<'a, P>
ferrocene_certified only.impl<'a, P> Clone for core::str::RSplit<'a, P>
ferrocene_certified only.impl<'a, P> Clone for RSplitN<'a, P>
ferrocene_certified only.impl<'a, P> Clone for RSplitTerminator<'a, P>
ferrocene_certified only.impl<'a, P> Clone for core::str::Split<'a, P>
ferrocene_certified only.impl<'a, P> Clone for SplitN<'a, P>
ferrocene_certified only.impl<'a, P> Clone for SplitTerminator<'a, P>
ferrocene_certified only.impl<'a, P: Pattern<Searcher<'a>: Clone>> Clone for core::str::SplitInclusive<'a, P>
ferrocene_certified only.impl<'a, T> Clone for RChunksExact<'a, T>
ferrocene_certified only.impl<'a, T: 'a, P: Clone> Clone for ChunkBy<'a, T, P>
ferrocene_certified only.impl<'a, T: Clone + 'a, const N: usize> Clone for ArrayWindows<'a, T, N>
impl<'a, const N: usize> Clone for CharArraySearcher<'a, N>
ferrocene_certified only.impl<'f> Clone for VaListImpl<'f>
ferrocene_certified only.impl<A> Clone for core::option::Iter<'_, A>
ferrocene_certified only.impl<A: Clone> Clone for Repeat<A>
ferrocene_certified only.impl<A: Clone> Clone for RepeatN<A>
ferrocene_certified only.impl<A: Clone> Clone for core::option::IntoIter<A>
impl<A: Clone> Clone for IterRange<A>
ferrocene_certified only.impl<A: Clone> Clone for IterRangeFrom<A>
ferrocene_certified only.impl<A: Clone> Clone for IterRangeInclusive<A>
ferrocene_certified only.impl<A: Clone, B: Clone> Clone for Chain<A, B>
ferrocene_certified only.impl<A: Clone, B: Clone> Clone for Zip<A, B>
impl<B: Clone, C: Clone> Clone for ControlFlow<B, C>
impl<Dyn: PointeeSized> Clone for DynMetadata<Dyn>
ferrocene_certified only.impl<F: Clone> Clone for FromFn<F>
ferrocene_certified only.impl<F: Clone> Clone for OnceWith<F>
ferrocene_certified only.impl<F: Clone> Clone for RepeatWith<F>
ferrocene_certified only.impl<G: Clone> Clone for FromCoroutine<G>
ferrocene_certified only.impl<H> Clone for BuildHasherDefault<H>
ferrocene_certified only.impl<I> Clone for DecodeUtf16<I>
ferrocene_certified only.impl<I, F, const N: usize> Clone for MapWindows<I, F, N>
ferrocene_certified only.impl<I, G> Clone for IntersperseWith<I, G>
ferrocene_certified only.impl<I, U> Clone for Flatten<I>
ferrocene_certified only.impl<I: Clone + Iterator> Clone for Intersperse<I>
ferrocene_certified only.impl<I: Clone + Iterator> Clone for Peekable<I>
ferrocene_certified only.impl<I: Clone + Iterator, const N: usize> Clone for ArrayChunks<I, N>
ferrocene_certified only.impl<I: Clone> Clone for FromIter<I>
ferrocene_certified only.impl<I: Clone> Clone for Cloned<I>
impl<I: Clone> Clone for Copied<I>
ferrocene_certified only.impl<I: Clone> Clone for Cycle<I>
ferrocene_certified only.impl<I: Clone> Clone for Enumerate<I>
ferrocene_certified only.impl<I: Clone> Clone for Fuse<I>
ferrocene_certified only.impl<I: Clone> Clone for Skip<I>
ferrocene_certified only.impl<I: Clone> Clone for StepBy<I>
ferrocene_certified only.impl<I: Clone> Clone for Take<I>
ferrocene_certified only.impl<I: Clone, F: Clone> Clone for FilterMap<I, F>
ferrocene_certified only.impl<I: Clone, F: Clone> Clone for Inspect<I, F>
ferrocene_certified only.impl<I: Clone, F: Clone> Clone for Map<I, F>
impl<I: Clone, P: Clone> Clone for Filter<I, P>
ferrocene_certified only.impl<I: Clone, P: Clone> Clone for MapWhile<I, P>
ferrocene_certified only.impl<I: Clone, P: Clone> Clone for SkipWhile<I, P>
ferrocene_certified only.impl<I: Clone, P: Clone> Clone for TakeWhile<I, P>
ferrocene_certified only.impl<I: Clone, St: Clone, F: Clone> Clone for Scan<I, St, F>
ferrocene_certified only.impl<I: Clone, U, F: Clone> Clone for FlatMap<I, U, F>
ferrocene_certified only.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 for RangeTo<Idx>
impl<Idx: Clone> Clone for core::ops::RangeToInclusive<Idx>
impl<Idx: Clone> Clone for core::range::Range<Idx>
ferrocene_certified only.impl<Idx: Clone> Clone for core::range::RangeFrom<Idx>
ferrocene_certified only.impl<Idx: Clone> Clone for core::range::RangeInclusive<Idx>
ferrocene_certified only.impl<Idx: Clone> Clone for core::range::RangeToInclusive<Idx>
ferrocene_certified only.impl<Ptr: Clone> Clone for Pin<Ptr>
ferrocene_certified only.impl<T> Clone for Option<T>where
T: Clone,
impl<T> Clone for Pending<T>
ferrocene_certified only.impl<T> Clone for Empty<T>
ferrocene_certified only.impl<T> Clone for PhantomContravariant<T>where
T: ?Sized,
ferrocene_certified only.impl<T> Clone for PhantomCovariant<T>where
T: ?Sized,
ferrocene_certified only.impl<T> Clone for PhantomInvariant<T>where
T: ?Sized,
ferrocene_certified only.impl<T> Clone for Discriminant<T>
ferrocene_certified only.impl<T> Clone for NonZero<T>where
T: ZeroablePrimitive,
ferrocene_certified only.impl<T> Clone for core::result::Iter<'_, T>
ferrocene_certified only.impl<T> Clone for Chunks<'_, T>
ferrocene_certified only.impl<T> Clone for ChunksExact<'_, T>
ferrocene_certified only.impl<T> Clone for core::slice::Iter<'_, T>
ferrocene_certified only.impl<T> Clone for RChunks<'_, T>
ferrocene_certified only.impl<T> Clone for Windows<'_, T>
ferrocene_certified only.impl<T> Clone for Exclusive<T>
ferrocene_certified only.impl<T, E> Clone for Result<T, E>
ferrocene_certified only.impl<T, P> Clone for core::slice::RSplit<'_, T, P>
ferrocene_certified only.impl<T, P> Clone for core::slice::Split<'_, T, P>
ferrocene_certified only.impl<T, P> Clone for core::slice::SplitInclusive<'_, T, P>
ferrocene_certified only.impl<T, const N: usize> Clone for Mask<T, N>
ferrocene_certified only.impl<T, const N: usize> Clone for Simd<T, N>
ferrocene_certified only.impl<T: Copy> Clone for Cell<T>
ferrocene_certified only.impl<T: Copy> Clone for MaybeUninit<T>
impl<T: PointeeSized> !Clone for &mut T
Shared references can be cloned, but mutable references cannot!
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 references cannot!
impl<T: PointeeSized> Clone for PhantomData<T>
ferrocene_certified only.impl<T: PointeeSized> Clone for NonNull<T>
impl<T: Clone + ?Sized> Clone for ManuallyDrop<T>
impl<T: Clone> Clone for Bound<T>
impl<T: Clone> Clone for Poll<T>
ferrocene_certified only.impl<T: Clone> Clone for OnceCell<T>
ferrocene_certified only.impl<T: Clone> Clone for RefCell<T>
ferrocene_certified only.impl<T: Clone> Clone for Reverse<T>
ferrocene_certified only.impl<T: Clone> Clone for Ready<T>
ferrocene_certified only.impl<T: Clone> Clone for Once<T>
ferrocene_certified only.impl<T: Clone> Clone for Rev<T>
ferrocene_certified only.impl<T: Clone> Clone for Saturating<T>
ferrocene_certified only.impl<T: Clone> Clone for Wrapping<T>
ferrocene_certified only.impl<T: Clone> Clone for core::result::IntoIter<T>
impl<T: Clone, F: Clone> Clone for Successors<T, F>
ferrocene_certified only.impl<T: Clone, const N: usize> Clone for [T; N]
impl<T: Clone, const N: usize> Clone for core::array::IntoIter<T, N>
impl<Y: Clone, R: Clone> Clone for CoroutineState<Y, R>
ferrocene_certified only.