Skip to main content

TryClone

Trait TryClone 

Source
pub trait TryClone: Sized {
    // Required method
    fn try_clone(&self) -> Result<Self, OutOfMemory>;

    // Provided method
    fn clone_panic_on_oom(&self) -> Self { ... }
}
Expand description

A trait for values that can be cloned, but contain owned, heap-allocated values whose allocations may fail during cloning.

Required Methods§

Source

fn try_clone(&self) -> Result<Self, OutOfMemory>

Attempt to clone self, returning an error if any allocation fails during cloning.

Provided Methods§

Source

fn clone_panic_on_oom(&self) -> Self

Clone self, panicking on allocation failure.

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.

Implementations on Foreign Types§

Source§

impl TryClone for bool

Source§

impl TryClone for char

Source§

impl TryClone for f32

Source§

impl TryClone for f64

Source§

impl TryClone for i8

Source§

impl TryClone for i16

Source§

impl TryClone for i32

Source§

impl TryClone for i64

Source§

impl TryClone for i128

Source§

impl TryClone for isize

Source§

impl TryClone for u8

Source§

impl TryClone for u16

Source§

impl TryClone for u32

Source§

impl TryClone for u64

Source§

impl TryClone for u128

Source§

impl TryClone for ()

Source§

impl TryClone for usize

Source§

impl TryClone for DefaultHashBuilder

Source§

impl<'a, T> TryClone for &'a T
where T: ?Sized,

Source§

impl<A> TryClone for (A,)
where A: TryClone,

Source§

impl<A, B> TryClone for (A, B)
where A: TryClone, B: TryClone,

Source§

impl<A, B, C> TryClone for (A, B, C)
where A: TryClone, B: TryClone, C: TryClone,

Source§

impl<A, B, C, D> TryClone for (A, B, C, D)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone,

Source§

impl<A, B, C, D, E> TryClone for (A, B, C, D, E)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone,

Source§

impl<A, B, C, D, E, F> TryClone for (A, B, C, D, E, F)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone,

Source§

impl<A, B, C, D, E, F, G> TryClone for (A, B, C, D, E, F, G)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone,

Source§

impl<A, B, C, D, E, F, G, H> TryClone for (A, B, C, D, E, F, G, H)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone,

Source§

impl<A, B, C, D, E, F, G, H, I> TryClone for (A, B, C, D, E, F, G, H, I)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone,

Source§

impl<A, B, C, D, E, F, G, H, I, J> TryClone for (A, B, C, D, E, F, G, H, I, J)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone,

Source§

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

Source§

impl<T> TryClone for Arc<T>

Implementors§

Source§

impl TryClone for GcLayout

Source§

impl TryClone for WasmCompositeInnerType

Source§

impl TryClone for WasmValType

Source§

impl TryClone for AbstractResourceIndex

Source§

impl TryClone for ComponentFuncIndex

Source§

impl TryClone for ComponentIndex

Source§

impl TryClone for ComponentInstanceIndex

Source§

impl TryClone for ComponentTypeIndex

Source§

impl TryClone for ComponentUpvarIndex

Source§

impl TryClone for DefinedResourceIndex

Source§

impl TryClone for ExportIndex

Source§

impl TryClone for ImportIndex

Source§

impl TryClone for LoweredIndex

Source§

impl TryClone for ModuleIndex

Source§

impl TryClone for ModuleInstanceIndex

Source§

impl TryClone for ModuleUpvarIndex

Source§

impl TryClone for OptionsIndex

Source§

impl TryClone for ResourceIndex

Source§

impl TryClone for RuntimeCallbackIndex

Source§

impl TryClone for RuntimeComponentInstanceIndex

Source§

impl TryClone for RuntimeImportIndex

Source§

impl TryClone for RuntimeInstanceIndex

Source§

impl TryClone for RuntimeMemoryIndex

Source§

impl TryClone for RuntimePostReturnIndex

Source§

impl TryClone for RuntimeReallocIndex

Source§

impl TryClone for RuntimeTableIndex

Source§

impl TryClone for StaticComponentIndex

Source§

impl TryClone for TrampolineIndex

Source§

impl TryClone for TypeComponentGlobalErrorContextTableIndex

Source§

impl TryClone for TypeComponentIndex

Source§

impl TryClone for TypeComponentInstanceIndex

Source§

impl TryClone for TypeComponentLocalErrorContextTableIndex

Source§

impl TryClone for TypeEnumIndex

Source§

impl TryClone for TypeFixedLengthListIndex

Source§

impl TryClone for TypeFlagsIndex

Source§

impl TryClone for TypeFuncIndex

Source§

impl TryClone for TypeFutureIndex

Source§

impl TryClone for TypeFutureTableIndex

Source§

impl TryClone for TypeListIndex

Source§

impl TryClone for TypeMapIndex

Source§

impl TryClone for TypeModuleIndex

Source§

impl TryClone for TypeOptionIndex

Source§

impl TryClone for TypeRecordIndex

Source§

impl TryClone for TypeResourceTableIndex

Source§

impl TryClone for TypeResultIndex

Source§

impl TryClone for TypeStreamIndex

Source§

impl TryClone for TypeStreamTableIndex

Source§

impl TryClone for TypeTupleIndex

Source§

impl TryClone for TypeVariantIndex

Source§

impl TryClone for Box<str>

Source§

impl TryClone for Atom

Source§

impl TryClone for DataIndex

Source§

impl TryClone for DefinedFuncIndex

Source§

impl TryClone for DefinedGlobalIndex

Source§

impl TryClone for DefinedMemoryIndex

Source§

impl TryClone for DefinedTableIndex

Source§

impl TryClone for DefinedTagIndex

Source§

impl TryClone for ElemIndex

Source§

impl TryClone for EngineInternedRecGroupIndex

Source§

impl TryClone for FuncIndex

Source§

impl TryClone for GcStructLayout

Source§

impl TryClone for GcStructLayoutField

Source§

impl TryClone for GlobalIndex

Source§

impl TryClone for MemoryIndex

Source§

impl TryClone for ModuleInternedRecGroupIndex

Source§

impl TryClone for ModuleInternedTypeIndex

Source§

impl TryClone for OwnedMemoryIndex

Source§

impl TryClone for PassiveElemIndex

Source§

impl TryClone for RecGroupRelativeTypeIndex

Source§

impl TryClone for StaticModuleIndex

Source§

impl TryClone for StringPool

Source§

impl TryClone for TableIndex

Source§

impl TryClone for TagIndex

Source§

impl TryClone for TypeIndex

Source§

impl TryClone for VMSharedTypeIndex

Source§

impl TryClone for WasmCompositeType

Source§

impl TryClone for WasmExnType

Source§

impl TryClone for WasmFieldType

Source§

impl TryClone for WasmFuncType

Source§

impl TryClone for WasmStructType

Source§

impl TryClone for WasmSubType

Source§

impl TryClone for RandomState

Source§

impl TryClone for TryString

Source§

impl<B> TryClone for TryCow<'_, B>
where B: TryToOwned + ?Sized,

Source§

impl<K, V> TryClone for NameMap<K, V>
where K: TryClone + Hash + Eq + Ord, V: TryClone,

Source§

impl<K, V, S> TryClone for TryHashMap<K, V, S>
where K: Eq + Hash + TryClone, V: TryClone, S: BuildHasher + TryClone,

Source§

impl<K, V, S> TryClone for TryIndexMap<K, V, S>
where K: Eq + Hash + TryClone, V: TryClone, S: BuildHasher + TryClone,

Source§

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

Source§

impl<T> TryClone for ManuallyDrop<T>
where T: TryClone,

Source§

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

Source§

impl<T> TryClone for PackedOption<T>

Source§

impl<T> TryClone for Box<[T]>
where T: TryClone,

Source§

impl<T> TryClone for Box<T>
where T: TryClone,

Source§

impl<T> TryClone for TryVec<T>
where T: TryClone,

Source§

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