[−][src]Struct coco::epoch::Ptr
A tagged nullable pointer.
Methods
impl<'p, T: 'p> Ptr<'p, T>[src]
pub fn null(tag: usize) -> Self[src]
Returns a null pointer with a tag.
Panics
Panics if the tag doesn't fit into the unused bits of an aligned pointer.
pub unsafe fn from_raw(raw: *mut T, tag: usize) -> Self[src]
Constructs a tagged pointer from a raw pointer and tag.
Panics
Panics if the tag doesn't fit into the unused bits of the pointer, or if the pointer is unaligned.
pub fn is_null(&self) -> bool[src]
Returns true if the pointer is null.
pub fn as_ref(&self) -> Option<&'p T>[src]
Converts the pointer to a reference.
pub fn as_raw(&self) -> *mut T[src]
Converts the pointer to a raw pointer.
pub fn unwrap(&self) -> &'p T[src]
pub fn tag(&self) -> usize[src]
Returns the tag.
pub fn with_tag(&self, tag: usize) -> Self[src]
Constructs a new tagged pointer with a different tag.
Panics
Panics if the tag doesn't fit into the unused bits of the pointer.
Trait Implementations
impl<'a, T> Clone for Ptr<'a, T>[src]
fn clone(&self) -> Self[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<'a, T> Copy for Ptr<'a, T>[src]
impl<'p, T> Default for Ptr<'p, T>[src]
impl<'p, T: Debug + 'p> Debug for Ptr<'p, T>[src]
Auto Trait Implementations
impl<'p, T> !Send for Ptr<'p, T>
impl<'p, T> !Sync for Ptr<'p, T>
impl<'p, T> Unpin for Ptr<'p, T>
impl<'p, T> UnwindSafe for Ptr<'p, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'p, T> RefUnwindSafe for Ptr<'p, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,