Skip to main content

TryClone

Trait TryClone 

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§

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

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

Provided Methods§

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§

§

impl TryClone for bool

§

impl TryClone for char

§

impl TryClone for f32

§

impl TryClone for f64

§

impl TryClone for i8

§

impl TryClone for i16

§

impl TryClone for i32

§

impl TryClone for i64

§

impl TryClone for i128

§

impl TryClone for isize

§

impl TryClone for u8

§

impl TryClone for u16

§

impl TryClone for u32

§

impl TryClone for u64

§

impl TryClone for u128

§

impl TryClone for ()

§

impl TryClone for usize

§

impl TryClone for DefaultHashBuilder

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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,

§

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,

§

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,

§

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,

§

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,

§

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

§

impl<T> TryClone for Arc<T>

§

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

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

§

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

§

impl TryClone for RandomState

§

impl TryClone for TryString

§

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,

§

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

§

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

§

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

§

impl<T> TryClone for PackedOption<T>

§

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

§

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

§

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

§

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