pub struct TraceSamplingSubscription { /* private fields */ }Expand description
Watches the latest accepted remote trace sampling configuration.
Create with new and read current before processing a batch of traces. This is a
latest-state watch, not a queue: successive concrete configurations can coalesce before you read them.
Once accepted, a concrete configuration remains available across withdrawal, cache expiry, polling-worker restart,
and rejected updates. An initially accepted empty assignment publishes RemoteSampling::Unassigned, for which
the consumer uses local settings. Later withdrawals never replace an accepted concrete configuration with that
marker.
The default subscription is inert: it receives no updates and contacts no service. Clones share a registration; dropping the last clone unsubscribes.
Implementations§
Source§impl TraceSamplingSubscription
impl TraceSamplingSubscription
Sourcepub fn new(client: &RemoteConfigurationClient) -> Result<Self, Error>
pub fn new(client: &RemoteConfigurationClient) -> Result<Self, Error>
Subscribes to APM_SAMPLING on client.
§Errors
Returns an error if client already has a live subscription to APM_SAMPLING.
Sourcepub fn current(&self) -> Option<Arc<RemoteSampling>>
pub fn current(&self) -> Option<Arc<RemoteSampling>>
Returns the current accepted snapshot immediately.
Returns None until the first accepted snapshot, not merely the first poll: polling may fail or reject an
update. An initially accepted empty assignment publishes RemoteSampling::Unassigned.
Each newly accepted concrete configuration gets a new Arc, even if its values are unchanged. Later withdrawals
and rejected updates preserve the current Arc; use Arc::ptr_eq to compare snapshot identity.
Trait Implementations§
Source§impl Clone for TraceSamplingSubscription
impl Clone for TraceSamplingSubscription
Source§fn clone(&self) -> TraceSamplingSubscription
fn clone(&self) -> TraceSamplingSubscription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TraceSamplingSubscription
impl Debug for TraceSamplingSubscription
Auto Trait Implementations§
impl Freeze for TraceSamplingSubscription
impl RefUnwindSafe for TraceSamplingSubscription
impl Send for TraceSamplingSubscription
impl Sync for TraceSamplingSubscription
impl Unpin for TraceSamplingSubscription
impl UnsafeUnpin for TraceSamplingSubscription
impl UnwindSafe for TraceSamplingSubscription
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