#[non_exhaustive]pub enum Principal {
Unauthenticated,
External(ExternalId),
System,
}Expand description
Authority principal. Three states, exhaustively type-checked.
Unauthenticated: caller identity has not been verified by L2 (pre-auth lobby, anonymous submit path). Authorization paths must treat this distinctly fromExternal(_).External: L2-verified external identity.System: kernel-internal origin (init, signal-relay, cleanup cascade, replay re-injection). Ships as a payloadless variant; aSystemOriginpayload widening is reserved (deferred).
#[non_exhaustive] protects the ABI: external consumers cannot match
exhaustively, so adding variants is not a breaking change for them.
Within-crate consumers see every variant and are forced by the linter
to match exhaustively.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unauthenticated
Caller identity has not been verified by L2 (pre-auth lobby, anonymous submit path).
External(ExternalId)
L2-verified external identity.
System
Kernel-internal origin (init, signal-relay, cleanup cascade, replay re-injection).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Principal
impl<'de> Deserialize<'de> for Principal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Principal
impl StructuralPartialEq for Principal
Auto Trait Implementations§
impl Freeze for Principal
impl RefUnwindSafe for Principal
impl Send for Principal
impl Sync for Principal
impl Unpin for Principal
impl UnsafeUnpin for Principal
impl UnwindSafe for Principal
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