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

Method as_dyn_core_error

crates/core/src/error/error.rs:1884–1895  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1882 }
1883
1884 pub(crate) fn as_dyn_core_error(&self) -> &(dyn core::error::Error + Send + Sync + 'static) {
1885 match self.unpack() {
1886 OomOrDynErrorRef::DynError(e) => {
1887 // Safety: invariant of this type.
1888 let vtable = unsafe { e.as_ref().vtable };
1889 // Safety: using the vtable associated with this pointer's
1890 // concrete type and the pointer is valid.
1891 unsafe { (vtable.as_dyn_core_error)(e) }
1892 }
1893 OomOrDynErrorRef::Oom(oom) => oom as _,
1894 }
1895 }
1896
1897 #[cfg(feature = "backtrace")]
1898 fn backtrace(&self) -> &Backtrace {

Callers 3

as_refMethod · 0.80
nextMethod · 0.80
sourceMethod · 0.80

Calls 2

unpackMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected