Lines Matching defs:ptr
20 use core::{marker::PhantomData, mem::ManuallyDrop, ops::Deref, ptr::NonNull};
66 /// The pointer stored in `ptr` is non-null and valid for the lifetime of the [`ARef`] instance. In
69 ptr: NonNull<T>,
97 pub unsafe fn from_raw(ptr: NonNull<T>) -> Self {
101 ptr,
114 /// use core::ptr::NonNull;
126 /// let ptr = NonNull::<Empty>::new(&mut data).unwrap();
128 /// let data_ref: ARef<Empty> = unsafe { ARef::from_raw(ptr) };
131 /// assert_eq!(ptr, raw_ptr);
134 ManuallyDrop::new(me).ptr
142 unsafe { Self::from_raw(self.ptr) }
151 unsafe { self.ptr.as_ref() }
167 unsafe { T::dec_ref(self.ptr) };