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

Method try_clone

crates/wasmtime/src/runtime/component/linker.rs:106–113  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

104
105impl TryClone for Definition {
106 fn try_clone(&self) -> Result<Self, OutOfMemory> {
107 Ok(match self {
108 Self::Instance(i) => Self::Instance(i.try_clone()?),
109 Self::Func(f) => Self::Func(f.try_clone()?),
110 Self::Module(m) => Self::Module(m.clone()),
111 Self::Resource(r, f) => Self::Resource(*r, f.try_clone()?),
112 })
113 }
114}
115
116impl<T: 'static> Linker<T> {

Callers 1

fromMethod · 0.45

Calls 6

OkFunction · 0.85
InstanceClass · 0.70
FuncClass · 0.70
ModuleClass · 0.70
ResourceClass · 0.50
cloneMethod · 0.45

Tested by

no test coverage detected