pub struct TenantCtx {
pub tenant: String,
pub lane_class: LaneClass,
pub rate_limit: Option<usize>,
pub key_prefix: Option<String>,
}Expand description
The resolved identity a request acts as — what flows to cache scoping, lane admission, rate-limit headers, and the usage/meter log line.
Fields§
§tenant: String§lane_class: LaneClass§rate_limit: Option<usize>§key_prefix: Option<String>The authenticated KEY’s identification prefix (mk-<tenant>-<12 hex> — the
same non-secret revoke handle stored in the keyring). None on the single-key /
open-server paths, which have no per-key identity. This is what lets a
metering implementation enforce per-key policy (spend caps) without the seam
ever seeing a credential.
Implementations§
Source§impl TenantCtx
impl TenantCtx
Sourcepub fn default_tenant() -> Self
pub fn default_tenant() -> Self
The single-key / open-server identity: tenant “default”, interactive, no override.
Trait Implementations§
impl StructuralPartialEq for TenantCtx
Auto Trait Implementations§
impl Freeze for TenantCtx
impl RefUnwindSafe for TenantCtx
impl Send for TenantCtx
impl Sync for TenantCtx
impl Unpin for TenantCtx
impl UnsafeUnpin for TenantCtx
impl UnwindSafe for TenantCtx
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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