MCPcopy Create free account
hub / github.com/bluejekyll/wasmtime-java / as_ref

Method as_ref

wasmtime-jni/src/opaque_ptr.rs:47–58  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

45
46 #[track_caller]
47 pub fn as_ref(&self) -> &'a T {
48 trace!("{:?}::as_ref", self);
49 assert_ne!(
50 self.ptr,
51 0,
52 "cannot deref null for &{}",
53 any::type_name::<T>()
54 );
55 let obj = self.ptr as *const T;
56
57 unsafe { &*obj }
58 }
59
60 #[track_caller]
61 pub fn as_mut(&mut self) -> &mut T {

Calls

no outgoing calls

Tested by

no test coverage detected