pub struct CallerAttribution { /* private fields */ }Expand description
Role plus principal for one connection, resolved by the daemon and never taken from the request body.
Fields are private and the constructors are per transport, so the pairings
that matter cannot be built by accident. In particular
Self::unattributed hardcodes Observer: an attribution failure must never
carry a privileged role, because that combination signs the worst possible
record — a claim that an Admin acted, naming nobody.
Implementations§
Source§impl CallerAttribution
impl CallerAttribution
Sourcepub fn from_peer_uid(uid: u32, role: CallerRole) -> Self
pub fn from_peer_uid(uid: u32, role: CallerRole) -> Self
A Unix-socket peer, attributed to the uid SO_PEERCRED reported.
Sourcepub fn from_vsock_token(role: CallerRole) -> Self
pub fn from_vsock_token(role: CallerRole) -> Self
A vsock peer that presented the pre-shared token.
Sourcepub fn unattributed() -> Self
pub fn unattributed() -> Self
A connection the daemon could not attribute. Always Observer.
pub fn role(&self) -> CallerRole
pub fn principal(&self) -> CallerPrincipal
Trait Implementations§
Source§impl Clone for CallerAttribution
impl Clone for CallerAttribution
Source§fn clone(&self) -> CallerAttribution
fn clone(&self) -> CallerAttribution
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CallerAttribution
Source§impl Debug for CallerAttribution
impl Debug for CallerAttribution
impl Eq for CallerAttribution
Source§impl PartialEq for CallerAttribution
impl PartialEq for CallerAttribution
impl StructuralPartialEq for CallerAttribution
Auto Trait Implementations§
impl Freeze for CallerAttribution
impl RefUnwindSafe for CallerAttribution
impl Send for CallerAttribution
impl Sync for CallerAttribution
impl Unpin for CallerAttribution
impl UnsafeUnpin for CallerAttribution
impl UnwindSafe for CallerAttribution
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more