pub struct CapId(/* private fields */);Expand description
Unpredictable capability token. Never a flow id.
0 is reserved as CapId::NONE (“no grant”, e.g. host hops without a
reply address). Minted ids are never zero.
Implementations§
Source§impl CapId
impl CapId
Sourcepub fn random() -> Result<Self, CapIdError>
pub fn random() -> Result<Self, CapIdError>
Draw a non-zero id from the OS CSPRNG. Never panics.
A failed OS read returns immediately. The reserved zero id is drawn
again, up to eight times, and then reported as CapIdError::ReservedZero
rather than as a dead generator.
pub const fn is_none(self) -> bool
pub const fn as_u128(self) -> u128
Trait Implementations§
impl Copy for CapId
impl Eq for CapId
impl StructuralPartialEq for CapId
Auto Trait Implementations§
impl Forget for CapId
impl Freeze for CapId
impl Move for CapId
impl RefUnwindSafe for CapId
impl Send for CapId
impl Sync for CapId
impl Unpin for CapId
impl UnsafeUnpin for CapId
impl UnwindSafe for CapId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.