pub struct Registry { /* private fields */ }Expand description
Maps semantic concepts to ordered attribute names, types, and conditions for lookups.
For example, the HTTP status-code concept can read either http.response.status_code or http.status_code.
A registry holds one complete set of mappings; remote registries replace rather than extend the embedded set.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn from_json(json: &str) -> Result<Self, GenericError>
pub fn from_json(json: &str) -> Result<Self, GenericError>
Parses a registry JSON string, rejecting malformed or unsupported entries.
§Errors
Uses the same validation as Self::from_slice. Errors may quote payload keys and must not be sent to the
remote endpoint.
Sourcepub fn from_slice(json: &[u8]) -> Result<Self, GenericError>
pub fn from_slice(json: &[u8]) -> Result<Self, GenericError>
Parses registry JSON, ignoring unknown concepts but validating mappings for known ones.
Use this for embedded mappings: invalid mappings for known concepts indicate a build defect. Concepts without a
Concept variant are skipped without validation because nothing can look them up. This allows upstream to add
concepts without a code change. Remote Configuration decoding also skips invalid mappings and fallbacks.
§Errors
Returns an error for invalid JSON, a missing or empty concepts object, or a missing or empty
metadata.content_hash string. For known concepts, also rejects malformed mappings and fallbacks with invalid
fields, including unknown providers or value types. Errors may quote payload keys; do not send them to the
remote endpoint.
Sourcepub fn content_hash(&self) -> &str
pub fn content_hash(&self) -> &str
Returns the registry’s metadata.content_hash label for logs and status.
This value is not computed or verified here; different mappings can carry the same label. Use
Self::fingerprint to detect changes.
Sourcepub fn fingerprint(&self) -> u64
pub fn fingerprint(&self) -> u64
Returns a non-cryptographic hash of the original JSON bytes for change detection within this process.
Compare fingerprints to decide whether to rebuild derived data, such as peer tag keys for APM stats. Formatting, metadata, and skipped entries also affect the hash. A collision can leave derived data stale; this is not an integrity check.
Sourcepub fn get_attribute_precedence(&self, concept: Concept) -> Option<&[TagInfo]>
pub fn get_attribute_precedence(&self, concept: Concept) -> Option<&[TagInfo]>
Returns the ordered list of attribute fallbacks for a concept, or
None if the concept has no registered mappings.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
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,
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>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read moreSource§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more