Trait TryClone
pub trait TryClone: Sized {
// Required method
fn try_clone(&self) -> Result<Self, OutOfMemory>;
}Expand description
A trait for values that can be cloned, but contain owned, heap-allocated values whose allocations may fail during cloning.
Required Methods§
fn try_clone(&self) -> Result<Self, OutOfMemory>
fn try_clone(&self) -> Result<Self, OutOfMemory>
Attempt to clone self, returning an error if any allocation fails
during cloning.
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.