rs::logging

Enum Level

Source
pub enum Level {
    Panic,
    Bug,
    Error,
    Warning,
    Surprise,
    Info,
    Debug,
}
Expand description

Levels are not in order.

Variants§

§

Panic

The program violated a self-imposed constraint, ended up in an inconsistent state, and cannot recover. Handlers must not actually panic. (should they?)

§

Bug

The program violated a self-imposed constraint, ended up in an inconsistent state, but some state can be recovered.

§

Error

Invalid data given by an external source, some state of the program must be dropped.

§

Warning

Invalid data given by an external source, parts of data are ignored. No previous program state needs to be dropped.

§

Surprise

External source not in an expected state, but not violating any protocols (including no relevant protocol).

§

Info

A change in internal state that results in a change of behaviour that a user can observe, and a tinkerer might find useful. E.g. selection of external sources, like loading user’s UI files, language switch, overrides.

§

Debug

Information useful for application developer only. Should be limited to information gotten from external sources, and more tricky parts of internal state.

Implementations§

Source§

impl Level

Source

fn as_str(&self) -> &'static str

Trait Implementations§

Source§

impl From<Problem> for Level

Source§

fn from(problem: Problem) -> Level

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Level

§

impl RefUnwindSafe for Level

§

impl Send for Level

§

impl Sync for Level

§

impl Unpin for Level

§

impl UnwindSafe for Level

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.