pub struct ScopeLabels {
pub namespace: String,
pub service: String,
}Expand description
Metrics labels for scoped requests.
Use this struct to pass scope information through the request pipeline for consistent metric labeling.
Fields§
§namespace: String§service: StringImplementations§
Source§impl ScopeLabels
impl ScopeLabels
Sourcepub fn from_scope(scope: &Scope) -> Self
pub fn from_scope(scope: &Scope) -> Self
Create labels from a scope.
Sourcepub fn service(&self) -> &str
pub fn service(&self) -> &str
Get the service label value (empty string if not in service scope).
Sourcepub fn is_namespace(&self) -> bool
pub fn is_namespace(&self) -> bool
Check if this is a namespace scope (not service).
Sourcepub fn is_service(&self) -> bool
pub fn is_service(&self) -> bool
Check if this is a service scope.
Trait Implementations§
Source§impl Clone for ScopeLabels
impl Clone for ScopeLabels
Source§fn clone(&self) -> ScopeLabels
fn clone(&self) -> ScopeLabels
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 moreSource§impl Debug for ScopeLabels
impl Debug for ScopeLabels
Source§impl Default for ScopeLabels
impl Default for ScopeLabels
Source§impl From<&Scope> for ScopeLabels
impl From<&Scope> for ScopeLabels
Auto Trait Implementations§
impl Freeze for ScopeLabels
impl RefUnwindSafe for ScopeLabels
impl Send for ScopeLabels
impl Sync for ScopeLabels
impl Unpin for ScopeLabels
impl UnsafeUnpin for ScopeLabels
impl UnwindSafe for ScopeLabels
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