MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / TryClone

Interface TryClone

crates/core/src/alloc/try_clone.rs:7–17  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

5/// A trait for values that can be cloned, but contain owned, heap-allocated
6/// values whose allocations may fail during cloning.
7pub trait TryClone: Sized {
8 /// Attempt to clone `self`, returning an error if any allocation fails
9 /// during cloning.
10 fn try_clone(&self) -> Result<Self, OutOfMemory>;
11
12 /// Clone `self`, panicking on allocation failure.
13 fn clone_panic_on_oom(&self) -> Self {
14 use super::PanicOnOom as _;
15 self.try_clone().panic_on_oom()
16 }
17}
18
19impl<T> TryClone for *mut T
20where

Callers 8

resolve_block_sigMethod · 0.80
cloneMethod · 0.80
cloneMethod · 0.80
from_wasmtimeMethod · 0.80
cloneMethod · 0.80
cloneMethod · 0.80
finishMethod · 0.80

Implementers 15

packed_option.rscranelift/entity/src/packed_option.rs
vec.rscrates/core/src/alloc/vec.rs
try_cow.rscrates/core/src/alloc/try_cow.rs
string.rscrates/core/src/alloc/string.rs
boxed.rscrates/core/src/alloc/boxed.rs
try_clone.rscrates/core/src/alloc/try_clone.rs
linker.rscrates/wasmtime/src/runtime/linker.rs
type_registry.rscrates/wasmtime/src/runtime/type_regis
linker.rscrates/wasmtime/src/runtime/component/
types.rscrates/environ/src/types.rs
gc.rscrates/environ/src/gc.rs
string_pool.rscrates/environ/src/string_pool.rs

Calls

no outgoing calls

Tested by

no test coverage detected