pub struct RateLimitContext {
pub tenant_id: TenantId,
pub provider_id: ProviderId,
pub scope: ScopeSet,
pub operation: String,
pub observed_at: OffsetDateTime,
}Expand description
Context shared with a RateLimitPolicy before an outbound call is made.
Fields§
§tenant_id: TenantIdTenant identifier for the call.
provider_id: ProviderIdProvider identifier for the call.
scope: ScopeSetNormalized scope set the broker is about to request.
operation: StringLogical operation (grant/flow) being attempted.
observed_at: OffsetDateTimeTimestamp the broker observed before invoking the policy.
Implementations§
Source§impl RateLimitContext
impl RateLimitContext
Sourcepub fn new(
tenant_id: TenantId,
provider_id: ProviderId,
scope: ScopeSet,
operation: impl Into<String>,
) -> Self
pub fn new( tenant_id: TenantId, provider_id: ProviderId, scope: ScopeSet, operation: impl Into<String>, ) -> Self
Creates a new context for the given tenant/provider/scope/operation tuple.
Sourcepub fn with_observed_at(self, instant: OffsetDateTime) -> Self
pub fn with_observed_at(self, instant: OffsetDateTime) -> Self
Overrides the timestamp associated with the observation.
Trait Implementations§
Source§impl Clone for RateLimitContext
impl Clone for RateLimitContext
Source§fn clone(&self) -> RateLimitContext
fn clone(&self) -> RateLimitContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for RateLimitContext
impl RefUnwindSafe for RateLimitContext
impl Send for RateLimitContext
impl Sync for RateLimitContext
impl Unpin for RateLimitContext
impl UnwindSafe for RateLimitContext
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