pub struct JwtLimits { /* private fields */ }Expand description
Compiled JWT-based limit resolution: the claim names to read from the token.
Implementations§
Source§impl JwtLimits
impl JwtLimits
Sourcepub fn from_config(cfg: &JwtLimitConfig) -> Self
pub fn from_config(cfg: &JwtLimitConfig) -> Self
Compile from config.
Sourcepub fn resolve(
&self,
claims: &Value,
profiles: &HashMap<String, CompiledProfile>,
) -> Option<CompiledProfile>
pub fn resolve( &self, claims: &Value, profiles: &HashMap<String, CompiledProfile>, ) -> Option<CompiledProfile>
Resolve a limit from the validated claims: a tier-name claim naming a
profile takes precedence, then explicit rpm (+ optional burst)
numbers. None when the token carries no limit hints.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JwtLimits
impl RefUnwindSafe for JwtLimits
impl Send for JwtLimits
impl Sync for JwtLimits
impl Unpin for JwtLimits
impl UnsafeUnpin for JwtLimits
impl UnwindSafe for JwtLimits
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request