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

Method with_context

crates/core/src/error/context.rs:143–152  ·  view source on GitHub ↗
(self, f: F)

Source from the content-addressed store, hash-verified

141
142 #[inline]
143 fn with_context<C, F>(self, f: F) -> Result<T>
144 where
145 C: fmt::Display + Send + Sync + 'static,
146 F: FnOnce() -> C,
147 {
148 match self {
149 Ok(x) => Ok(x),
150 Err(e) => Err(Error::new(e).context(f())),
151 }
152 }
153}
154
155impl<T> Context<T, Error> for Result<T> {

Callers 15

runFunction · 0.80
read_to_stringFunction · 0.80
cat_oneFunction · 0.80
runFunction · 0.80
parse_inputFunction · 0.80
runFunction · 0.80
handle_moduleFunction · 0.80
newMethod · 0.80
mainFunction · 0.80
load_moduleMethod · 0.80
executeMethod · 0.80

Calls 4

OkFunction · 0.85
newFunction · 0.50
fFunction · 0.50
contextMethod · 0.45

Tested by 8

process_expandedFunction · 0.64
are_artifacts_availableFunction · 0.64
are_artifacts_availableFunction · 0.64
are_artifacts_availableFunction · 0.64