pub struct Handle(u64);Expand description
A process-local capability handle.
Layout: [63:56] = 0, [55:24] = generation, [23:0] = table index.
Value 0 is never valid, and the high byte is always zero so a handle in
RAX never looks like a negative errno.
Tuple Fields§
§0: u64Implementations§
Source§impl Handle
impl Handle
Sourcepub const fn new(index: u32, generation: u32) -> Self
pub const fn new(index: u32, generation: u32) -> Self
Build a handle from a table index and a generation.
The index is masked to 24 bits, the generation to 32 bits; bits 56..64 of the result are always zero.
Sourcepub const fn generation(self) -> u32
pub const fn generation(self) -> u32
The generation ([55:24]).
Trait Implementations§
impl Copy for Handle
impl Eq for Handle
Source§impl Ord for Handle
impl Ord for Handle
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Handle
impl PartialOrd for Handle
impl StructuralPartialEq for Handle
Auto Trait Implementations§
impl Forget for Handle
impl Freeze for Handle
impl Move for Handle
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnsafeUnpin for Handle
impl UnwindSafe for Handle
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