Struct tracing_configuration::Subscriber
source · pub struct Subscriber {
pub format: Option<Format>,
pub writer: Option<Writer>,
}Expand description
Configuration for a totally dynamic subscriber.
Fields§
§format: Option<Format>§writer: Option<Writer>Implementations§
source§impl Subscriber
impl Subscriber
sourcepub fn layer<S>(self) -> (Layer<S>, Guard)where
S: Subscriber + for<'s> LookupSpan<'s>,
pub fn layer<S>(self) -> (Layer<S>, Guard)where
S: Subscriber + for<'s> LookupSpan<'s>,
Create a new Layer, and a Guard that handles e.g flushing NonBlocking IO.
Errors when opening files or directories are deferred for the subscriber to handle (typically by logging).
If you wish to handle them yourself, see Self::try_layer.
sourcepub fn try_layer<S>(self) -> Result<(Layer<S>, Guard), Error>where
S: Subscriber + for<'s> LookupSpan<'s>,
pub fn try_layer<S>(self) -> Result<(Layer<S>, Guard), Error>where
S: Subscriber + for<'s> LookupSpan<'s>,
Create a new Layer, and a Guard that handles e.g flushing NonBlocking IO.
Returns Err if e.g opening a log file fails.
If you wish the subscriber to handle them (typically by logging), see Self::layer.
sourcepub fn builder(self) -> (SubscriberBuilder, Guard)
pub fn builder(self) -> (SubscriberBuilder, Guard)
Create a new SubscriberBuilder, and a Guard that handles e.g flushing NonBlocking IO.
Errors when opening files or directories are deferred for the subscriber to handle (typically by logging).
If you wish to handle them yourself, see Self::try_builder.
sourcepub fn try_builder(self) -> Result<(SubscriberBuilder, Guard), Error>
pub fn try_builder(self) -> Result<(SubscriberBuilder, Guard), Error>
Create a new SubscriberBuilder, and a Guard that handles e.g flushing NonBlocking IO.
Returns Err if e.g opening a log file fails.
If you wish the subscriber to handle them (typically by logging), see Self::builder.
Trait Implementations§
source§impl Clone for Subscriber
impl Clone for Subscriber
source§fn clone(&self) -> Subscriber
fn clone(&self) -> Subscriber
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for Subscriber
impl Debug for Subscriber
source§impl Default for Subscriber
impl Default for Subscriber
source§fn default() -> Subscriber
fn default() -> Subscriber
source§impl<'de> Deserialize<'de> for Subscriber
impl<'de> Deserialize<'de> for Subscriber
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Hash for Subscriber
impl Hash for Subscriber
source§impl Ord for Subscriber
impl Ord for Subscriber
source§fn cmp(&self, other: &Subscriber) -> Ordering
fn cmp(&self, other: &Subscriber) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for Subscriber
impl PartialEq for Subscriber
source§fn eq(&self, other: &Subscriber) -> bool
fn eq(&self, other: &Subscriber) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for Subscriber
impl PartialOrd for Subscriber
source§fn partial_cmp(&self, other: &Subscriber) -> Option<Ordering>
fn partial_cmp(&self, other: &Subscriber) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl Serialize for Subscriber
impl Serialize for Subscriber
impl Eq for Subscriber
impl StructuralPartialEq for Subscriber
Auto Trait Implementations§
impl Freeze for Subscriber
impl RefUnwindSafe for Subscriber
impl Send for Subscriber
impl Sync for Subscriber
impl Unpin for Subscriber
impl UnwindSafe for Subscriber
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)