[][src]Enum spirit_log::background::OverflowMode

#[non_exhaustive]pub enum OverflowMode {
    Block,
    DropMsg,
    DropMsgSilently,
    AdaptiveDrop {
        from_level: Level,
        fill_limit: usize,
    },
}

Selection of how to act if the channel to the logger thread is full.

This enum is non-exhaustive. Adding more variants in the future will not be considered a breaking change.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Block

Blocks until there's enough space to push the message.

DropMsg

If there's not enough space in the channel, the message is dropped and counted.

Subsequently, the thread will log how many messages were lost.

DropMsgSilently

Drop the messages that don't without any indication it happened.

AdaptiveDrop

Drop less severe messages sooner than filling the whole buffer.

If the buffer is completely full, it acts like the DropMsg. If it's not full, but has more than fill_limit messages in it, messages with severity from_level or less severe are dropped, while more severe are still inserted into the buffer.

Both limits are inclusive.

Fields of AdaptiveDrop

from_level: Level

Level of severity of messages to drop if the buffer is more full that from_level.

fill_limit: usize

The level at which the less severe messages start being dropped.

Trait Implementations

impl Clone for OverflowMode[src]

impl Copy for OverflowMode[src]

impl Debug for OverflowMode[src]

impl Eq for OverflowMode[src]

impl Hash for OverflowMode[src]

impl Ord for OverflowMode[src]

impl PartialEq<OverflowMode> for OverflowMode[src]

impl PartialOrd<OverflowMode> for OverflowMode[src]

impl StructuralEq for OverflowMode[src]

impl StructuralPartialEq for OverflowMode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoResult<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.