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

Method from

wasmtime-jni/src/opaque_ptr.rs:30–44  ·  view source on GitHub ↗
(val: T)

Source from the content-addressed store, hash-verified

28
29impl<'a, T> OpaquePtr<'a, T> {
30 pub(crate) fn from(val: T) -> Self
31 where
32 T: Sized + Opaqueable,
33 {
34 let ptr: jlong = Box::into_raw(Box::new(val)) as jlong;
35
36 let this = Self {
37 ptr,
38 ty: PhantomData,
39 };
40
41 debug!("{:?}::from", this);
42
43 this
44 }
45
46 #[track_caller]
47 pub fn as_ref(&self) -> &'a T {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected