rs::logging

Trait Warn

Source
pub trait Warn
where Self: Sized,
{ type Value; // Required method fn or_warn<H: Handler>( self, handler: &mut H, level: Problem, message: &str, ) -> Option<Self::Value>; // Provided method fn or_print(self, level: Problem, message: &str) -> Option<Self::Value> { ... } }
Expand description

Sugar for logging errors in results.

Required Associated Types§

Required Methods§

Source

fn or_warn<H: Handler>( self, handler: &mut H, level: Problem, message: &str, ) -> Option<Self::Value>

Approach 3.

Provided Methods§

Source

fn or_print(self, level: Problem, message: &str) -> Option<Self::Value>

Approach 2.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> Warn for Option<T>

Source§

type Value = T

Source§

fn or_warn<H: Handler>( self, handler: &mut H, level: Problem, message: &str, ) -> Option<T>

Source§

impl<T, E: Display> Warn for Result<T, E>

Source§

type Value = T

Source§

fn or_warn<H: Handler>( self, handler: &mut H, level: Problem, message: &str, ) -> Option<T>

Implementors§