pub struct AuthenticatedPrincipal { /* private fields */ }Expand description
Opaque, bounded canonical principal returned by a trusted resolver.
Canonical bytes are zeroized on drop. The type intentionally implements no
Debug, Display, serialization, cloning, equality, AsRef, Deref, or
implicit conversion traits.
ⓘ
use gaze_proxy::AuthenticatedPrincipal;
let principal = AuthenticatedPrincipal::try_from_canonical_bytes(b"tenant-a".to_vec())?;
let _ = format!("{principal:?}");ⓘ
use gaze_proxy::AuthenticatedPrincipal;
let principal = AuthenticatedPrincipal::try_from_canonical_bytes(b"tenant-a".to_vec())?;
let _ = format!("{principal}");ⓘ
use gaze_proxy::AuthenticatedPrincipal;
let principal = AuthenticatedPrincipal::try_from_canonical_bytes(b"tenant-a".to_vec())?;
let _ = principal.clone();ⓘ
use gaze_proxy::AuthenticatedPrincipal;
let principal = AuthenticatedPrincipal::try_from_canonical_bytes(b"tenant-a".to_vec())?;
let _ = serde_json::to_vec(&principal)?;ⓘ
use gaze_proxy::AuthenticatedPrincipal;
fn requires_as_ref<T: AsRef<[u8]>>() {}
requires_as_ref::<AuthenticatedPrincipal>();ⓘ
use gaze_proxy::AuthenticatedPrincipal;
let _ = AuthenticatedPrincipal { canonical_bytes: Vec::new() };Implementations§
Source§impl AuthenticatedPrincipal
impl AuthenticatedPrincipal
Sourcepub fn try_from_canonical_bytes(
canonical_bytes: Vec<u8>,
) -> Result<Self, PrincipalResolveError>
pub fn try_from_canonical_bytes( canonical_bytes: Vec<u8>, ) -> Result<Self, PrincipalResolveError>
Constructs a bounded canonical identity for return from a trusted resolver.
Auto Trait Implementations§
impl Freeze for AuthenticatedPrincipal
impl RefUnwindSafe for AuthenticatedPrincipal
impl Send for AuthenticatedPrincipal
impl Sync for AuthenticatedPrincipal
impl Unpin for AuthenticatedPrincipal
impl UnsafeUnpin for AuthenticatedPrincipal
impl UnwindSafe for AuthenticatedPrincipal
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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