pub struct Ptr<T> {
ptr: NonNull<PtrCell<T>>,
_marker: PhantomData<PtrCell<T>>,
}Expand description
Heap-backed pointer value with one explicit level of indirection.
Fields§
§ptr: NonNull<PtrCell<T>>§_marker: PhantomData<PtrCell<T>>Implementations§
Source§impl<T> Ptr<T>
impl<T> Ptr<T>
Sourcepub fn new_tracked(value: T, site: &'static str) -> Self
pub fn new_tracked(value: T, site: &'static str) -> Self
Allocate one new pointer payload with allocation-site metadata.
fn cell(&self) -> &PtrCell<T>
fn cell_mut(&mut self) -> &mut PtrCell<T>
fn release(&mut self)
Sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Borrow the current payload mutably.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Ptr<T>
impl<T> RefUnwindSafe for Ptr<T>where
T: RefUnwindSafe,
impl<T> !Send for Ptr<T>
impl<T> !Sync for Ptr<T>
impl<T> Unpin for Ptr<T>where
T: Unpin,
impl<T> UnwindSafe for Ptr<T>where
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more