pub struct Scoping {
pub organization_id: OrganizationId,
pub project_id: ProjectId,
pub project_key: ProjectKey,
pub key_id: Option<u64>,
}Expand description
Data scoping information for rate limiting and quota enforcement.
Scoping holds all the identifiers needed to attribute data to specific
organizations, projects, and keys. This allows the rate limiting and quota
systems to enforce limits at the appropriate scope levels.
Fields§
§organization_id: OrganizationIdThe organization id.
project_id: ProjectIdThe project id.
project_key: ProjectKeyThe DSN public key.
key_id: Option<u64>The public key’s internal id.
Implementations§
Source§impl Scoping
impl Scoping
Sourcepub fn item(&self, category: DataCategory) -> ItemScoping
pub fn item(&self, category: DataCategory) -> ItemScoping
Creates an ItemScoping for a specific data category in this scope.
The returned item scoping contains a reference to this scope and the provided data category. This is a cheap operation that allows for efficient rate limiting of individual items.
Sourcepub fn metric_bucket(&self, namespace: MetricNamespace) -> ItemScoping
pub fn metric_bucket(&self, namespace: MetricNamespace) -> ItemScoping
Creates an ItemScoping specifically for metric buckets in this scope.
The returned item scoping contains a reference to this scope, the
DataCategory::MetricBucket category, and the provided metric namespace.
This is specialized for handling metrics with namespaces.
Trait Implementations§
Source§impl Ord for Scoping
impl Ord for Scoping
Source§impl PartialOrd for Scoping
impl PartialOrd for Scoping
impl Copy for Scoping
impl Eq for Scoping
impl StructuralPartialEq for Scoping
Auto Trait Implementations§
impl Freeze for Scoping
impl RefUnwindSafe for Scoping
impl Send for Scoping
impl Sync for Scoping
impl Unpin for Scoping
impl UnwindSafe for Scoping
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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