Struct logforth::Dispatch

source ·
pub struct Dispatch<const LAYOUT: bool = true, const APPEND: bool = true> { /* private fields */ }
Expand description

A grouped set of appenders, filters, and optional layout.

The Logger facade dispatches log records to one or more Dispatch instances. Each Dispatch instance contains a set of filters, appenders, and an optional layout.

filters are used to determine whether a log record should be passed to the appenders. appends are used to write log records to a destination. Each appender has its own default layout. If the Dispatch has a layout, it will be used instead of the default layout.

Implementations§

source§

impl Dispatch<false, false>

source

pub fn new() -> Dispatch<false, false>

Create a new incomplete Dispatch instance.

At least one append must be added to the Dispatch before it can be used.

source

pub fn filter(self, filter: impl Into<Filter>) -> Dispatch<false, false>

Add a Filter to the Dispatch.

source

pub fn layout(self, layout: impl Into<Layout>) -> Dispatch<true, false>

Add the preferred Layout to the Dispatch. At most one layout can be added to a Dispatch.

source§

impl<const LAYOUT: bool, const APPEND: bool> Dispatch<LAYOUT, APPEND>

source

pub fn append(self, append: impl Append) -> Dispatch<true, true>

Add an Append to the Dispatch.

Trait Implementations§

source§

impl<const LAYOUT: bool, const APPEND: bool> Debug for Dispatch<LAYOUT, APPEND>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Dispatch<false, false>

source§

fn default() -> Dispatch<false, false>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<const LAYOUT: bool, const APPEND: bool> Freeze for Dispatch<LAYOUT, APPEND>

§

impl<const LAYOUT: bool = true, const APPEND: bool = true> !RefUnwindSafe for Dispatch<LAYOUT, APPEND>

§

impl<const LAYOUT: bool, const APPEND: bool> Send for Dispatch<LAYOUT, APPEND>

§

impl<const LAYOUT: bool, const APPEND: bool> Sync for Dispatch<LAYOUT, APPEND>

§

impl<const LAYOUT: bool, const APPEND: bool> Unpin for Dispatch<LAYOUT, APPEND>

§

impl<const LAYOUT: bool = true, const APPEND: bool = true> !UnwindSafe for Dispatch<LAYOUT, APPEND>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FutureExt for T

source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more