pub struct Tag(/* private fields */);Expand description
Represents a generation tag used for ABA protection in AtomicTaggedPtr.
Tag wraps a platform-specific generation count and ensures that any operations
(like wrapping addition or creation) respect the hardware platform’s limits and bit-width.
Implementations§
Source§impl Tag
impl Tag
Sourcepub const fn new(value: usize) -> Self
pub const fn new(value: usize) -> Self
Creates a new Tag from a raw value, applying the platform-specific mask.
Sourcepub const fn wrapping_add(self, rhs: usize) -> Self
pub const fn wrapping_add(self, rhs: usize) -> Self
Performs wrapping addition on the tag value.
Sourcepub const fn wrapping_sub(self, rhs: usize) -> Self
pub const fn wrapping_sub(self, rhs: usize) -> Self
Performs wrapping subtraction on the tag value.
Trait Implementations§
Source§impl AddAssign<usize> for Tag
impl AddAssign<usize> for Tag
Source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+= operation. Read moreSource§impl BitAndAssign<usize> for Tag
impl BitAndAssign<usize> for Tag
Source§fn bitand_assign(&mut self, rhs: usize)
fn bitand_assign(&mut self, rhs: usize)
Performs the
&= operation. Read moreSource§impl BitAndAssign for Tag
impl BitAndAssign for Tag
Source§fn bitand_assign(&mut self, rhs: Tag)
fn bitand_assign(&mut self, rhs: Tag)
Performs the
&= operation. Read moreSource§impl BitOrAssign<usize> for Tag
impl BitOrAssign<usize> for Tag
Source§fn bitor_assign(&mut self, rhs: usize)
fn bitor_assign(&mut self, rhs: usize)
Performs the
|= operation. Read moreSource§impl BitOrAssign for Tag
impl BitOrAssign for Tag
Source§fn bitor_assign(&mut self, rhs: Tag)
fn bitor_assign(&mut self, rhs: Tag)
Performs the
|= operation. Read moreSource§impl BitXorAssign<usize> for Tag
impl BitXorAssign<usize> for Tag
Source§fn bitxor_assign(&mut self, rhs: usize)
fn bitxor_assign(&mut self, rhs: usize)
Performs the
^= operation. Read moreSource§impl BitXorAssign for Tag
impl BitXorAssign for Tag
Source§fn bitxor_assign(&mut self, rhs: Tag)
fn bitxor_assign(&mut self, rhs: Tag)
Performs the
^= operation. Read moreSource§impl Ord for Tag
impl Ord for Tag
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Tag
impl PartialOrd for Tag
Source§impl SubAssign<usize> for Tag
impl SubAssign<usize> for Tag
Source§fn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
Performs the
-= operation. Read moreimpl Copy for Tag
impl Eq for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl Freeze for Tag
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnsafeUnpin for Tag
impl UnwindSafe for Tag
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