pub struct Rank(/* private fields */);Expand description
A rank value for ordering register operations
Encodes both a process identifier and a sequence number into a single u64.
The high 32 bits hold the sequence number, and the low 32 bits hold the
process ID. This ensures that ranks from the same process are ordered by
sequence, and ties between different processes are broken by process ID.
§Encoding
|--- sequence (32 bits) ---|--- process_id (32 bits) ---|Implementations§
Source§impl Rank
impl Rank
Sourcepub fn new(process_id: u32, sequence: u32) -> Self
pub fn new(process_id: u32, sequence: u32) -> Self
Create a new rank from a process ID and sequence number
The sequence occupies the high 32 bits and the process ID the low 32 bits, so ranks are ordered primarily by sequence, then by process ID.
Sourcepub fn process_id(&self) -> u32
pub fn process_id(&self) -> u32
Returns the process ID component of this rank
Trait Implementations§
Source§impl Ord for Rank
impl Ord for Rank
Source§impl PartialOrd for Rank
impl PartialOrd for Rank
impl Copy for Rank
impl Eq for Rank
impl StructuralPartialEq for Rank
Auto Trait Implementations§
impl Freeze for Rank
impl RefUnwindSafe for Rank
impl Send for Rank
impl Sync for Rank
impl Unpin for Rank
impl UnwindSafe for Rank
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