[−][src]Struct cgc_single_threaded::mem::TaggedPointer
Structure wrapping a raw, tagged pointer.
Fields
raw: *mut T
Methods
impl<T> TaggedPointer<T>
[src]
pub fn new(raw: *mut T) -> TaggedPointer<T>
[src]
Returns a new TaggedPointer without setting any bits.
pub fn with_bit(raw: *mut T, bit: usize) -> TaggedPointer<T>
[src]
Returns a new TaggedPointer with the given bit set.
pub fn unset_bit(&mut self, bit: usize)
[src]
pub const fn null() -> TaggedPointer<T>
[src]
Returns a null pointer.
pub fn untagged(self) -> *mut T
[src]
Returns the wrapped pointer without any tags.
pub fn without_tags(self) -> Self
[src]
Returns a new TaggedPointer using the current pointer but without any tags.
pub fn bit_is_set(self, bit: usize) -> bool
[src]
Returns true if the given bit is set.
pub fn set_bit(&mut self, bit: usize)
[src]
Sets the given bit.
pub fn is_null(self) -> bool
[src]
Returns true if the current pointer is a null pointer.
pub fn as_ref<'a>(self) -> Option<&'a T>
[src]
Returns an immutable to the pointer's value.
pub fn as_mut<'a>(self) -> Option<&'a mut T>
[src]
Returns a mutable reference to the pointer's value.
pub fn compare_and_swap(&self, current: *mut T, other: *mut T) -> bool
[src]
Atomically swaps the internal pointer with another one.
This boolean returns true if the pointer was swapped, false otherwise.
pub fn atomic_store(&self, other: *mut T)
[src]
Atomically replaces the current pointer with the given one.
pub fn atomic_load(&self) -> *mut T
[src]
Atomically loads the pointer.
pub fn atomic_bit_is_set(&self, bit: usize) -> bool
[src]
Checks if a bit is set using an atomic load.
Trait Implementations
impl<T> Clone for TaggedPointer<T>
[src]
fn clone(&self) -> TaggedPointer<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Copy for TaggedPointer<T>
[src]
impl<T: Debug + ?Sized> Debug for TaggedPointer<T>
[src]
impl<T> Eq for TaggedPointer<T>
[src]
impl<T> Hash for TaggedPointer<T>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T> PartialEq<TaggedPointer<T>> for TaggedPointer<T>
[src]
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for TaggedPointer<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> !Send for TaggedPointer<T>
impl<T> !Sync for TaggedPointer<T>
impl<T: ?Sized> Unpin for TaggedPointer<T>
impl<T: ?Sized> UnwindSafe for TaggedPointer<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,