pub struct DiagnosticCollector { /* private fields */ }Expand description
A named, on-demand producer of diagnostic artifact bytes.
A collector pairs an artifact name with a synchronous closure that produces the artifact’s bytes when
invoked. Collectors are registered through a DiagnosticsEmitter and gathered on
demand by whichever subsystem is responsible for assembling diagnostic artifacts.
The artifact name is suitable, but not guaranteed, to be used as a filename.
Implementations§
Source§impl DiagnosticCollector
impl DiagnosticCollector
Sourcepub fn new<T>(
artifact_name: impl Into<String>,
collect_fn: impl Fn() -> T + Send + Sync + 'static,
) -> Self
pub fn new<T>( artifact_name: impl Into<String>, collect_fn: impl Fn() -> T + Send + Sync + 'static, ) -> Self
Creates a new collector with the given artifact name and collection closure.
collect_fn runs synchronously and must return promptly, as it can delay the collection of artifacts for the
whole system.
Sourcepub fn artifact_name(&self) -> &str
pub fn artifact_name(&self) -> &str
Returns the artifact name.
Trait Implementations§
Source§impl Clone for DiagnosticCollector
impl Clone for DiagnosticCollector
Source§fn clone(&self) -> DiagnosticCollector
fn clone(&self) -> DiagnosticCollector
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 moreAuto Trait Implementations§
impl Freeze for DiagnosticCollector
impl !RefUnwindSafe for DiagnosticCollector
impl Send for DiagnosticCollector
impl Sync for DiagnosticCollector
impl Unpin for DiagnosticCollector
impl !UnwindSafe for DiagnosticCollector
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
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>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Instruments this type by attaching the given resource group token, returning a
Tracked wrapper. Read more§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Instruments this type by attaching the current resource group, returning a
Tracked wrapper. Read more