pub struct CapId(pub [u8; 16]);Expand description
An unforgeable capability identifier.
Tuple Fields§
§0: [u8; 16]Implementations§
Source§impl CapId
impl CapId
Sourcepub fn derive(secret: &[u8; 32], serial: u64, parent: Option<&CapId>) -> CapId
pub fn derive(secret: &[u8; 32], serial: u64, parent: Option<&CapId>) -> CapId
Derive an id from the kernel secret, serial and parent.
Deterministic for a given kernel (which makes tests and replays stable), unpredictable to a peer without the secret.
Sourcepub fn hex(self) -> String
pub fn hex(self) -> String
Hex form for logs and errors.
This is the raw capability id and is authority: possession of it is
enough to call the object while the kernel lives. Prefer
CapId::correlation_id in telemetry; hex is for an explicit,
deliberate transfer (the peer CLI prints it so a caller can use it).
Sourcepub fn correlation_id(self) -> String
pub fn correlation_id(self) -> String
A non-reversible correlation id for logs and events.
Logs can correlate two events that mention the same capability without carrying the authority itself.
Trait Implementations§
impl Copy for CapId
impl Eq for CapId
Source§impl Ord for CapId
impl Ord for CapId
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 CapId
impl PartialOrd for CapId
impl StructuralPartialEq for CapId
Auto Trait Implementations§
impl Freeze 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> Comparable<K> for Q
impl<Q, K> Comparable<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.