pub struct SemanticRegistryProvider { /* private fields */ }Expand description
Supplies semantic mappings from either the embedded registry or the latest accepted remote update.
Consumers find attribute names for concepts such as HTTP status code without choosing a registry source. The default provider always returns the embedded registry: it never subscribes or waits for updates. Use it when Remote Configuration is disabled by configuration or deployment policy.
With a live subscription to APM_SEMANTIC_CORE_DD, the provider uses the embedded registry until an update is
accepted, then returns the latest accepted registry. Rejected updates leave that registry unchanged.
Clones share the subscription. Each component calls Self::snapshot at its batch boundary to keep one set of
mappings throughout processing.
Implementations§
Source§impl SemanticRegistryProvider
impl SemanticRegistryProvider
Sourcepub fn subscribe(client: &RemoteConfigurationClient) -> Result<Self, Error>
pub fn subscribe(client: &RemoteConfigurationClient) -> Result<Self, Error>
Subscribes to APM_SEMANTIC_CORE_DD on client.
Clone the returned provider for every component that reads the registry; a second subscription to the product on the same client fails.
§Errors
Returns an error if client already has a live subscription to APM_SEMANTIC_CORE_DD.
Sourcepub fn snapshot(&self) -> Arc<Registry>
pub fn snapshot(&self) -> Arc<Registry>
Returns the latest accepted registry, or the embedded registry if the subscription has no accepted value.
Returns immediately, without waiting for an update. The registry is immutable and remains valid after later updates. Call once per batch and use the result throughout; calling again can return a newer registry.
Trait Implementations§
Source§impl Clone for SemanticRegistryProvider
impl Clone for SemanticRegistryProvider
Source§fn clone(&self) -> SemanticRegistryProvider
fn clone(&self) -> SemanticRegistryProvider
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SemanticRegistryProvider
impl Debug for SemanticRegistryProvider
Auto Trait Implementations§
impl Freeze for SemanticRegistryProvider
impl RefUnwindSafe for SemanticRegistryProvider
impl Send for SemanticRegistryProvider
impl Sync for SemanticRegistryProvider
impl Unpin for SemanticRegistryProvider
impl UnsafeUnpin for SemanticRegistryProvider
impl UnwindSafe for SemanticRegistryProvider
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