pub struct RawPtr<'g, T> { /* private fields */ }Expand description
RawPtr is a raw pointer where the lifetime of the pointed-to instance is not managed.
RawPtr cannot dereference the pointed-to instance unless it is converted into Ptr
through RawPtr::into_ptr.
Implementations§
Source§impl<'g, T> RawPtr<'g, T>
impl<'g, T> RawPtr<'g, T>
Sourcepub fn without_tag(self) -> Self
pub fn without_tag(self) -> Self
Sourcepub const unsafe fn into_ptr(self) -> Ptr<'g, T>
pub const unsafe fn into_ptr(self) -> Ptr<'g, T>
Converts itself into a Ptr to dereference the instance.
§Safety
The pointed-to instance must be valid for the lifetime 'g.
§Examples
use sdd::Owned;
let owned: Owned<usize> = Owned::new(83);
let ptr = owned.into_raw();
assert_eq!(unsafe { ptr.into_ptr().as_ref() }, Some(&83));
drop(unsafe { Owned::from_raw(ptr) });Trait Implementations§
impl<T> Copy for RawPtr<'_, T>
impl<T> Eq for RawPtr<'_, T>
impl<T: UnwindSafe> UnwindSafe for RawPtr<'_, T>
Auto Trait Implementations§
impl<'g, T> Freeze for RawPtr<'g, T>
impl<'g, T> RefUnwindSafe for RawPtr<'g, T>where
T: RefUnwindSafe,
impl<'g, T> !Send for RawPtr<'g, T>
impl<'g, T> !Sync for RawPtr<'g, T>
impl<'g, T> Unpin for RawPtr<'g, T>
impl<'g, T> UnsafeUnpin for RawPtr<'g, T>
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