Skip to main content

Logging

Trait Logging 

Source
pub trait Logging {
    const KIND: &'static str;

    // Required methods
    fn with_logger<F, R>(&self, f: F) -> R
       where F: FnOnce(&Logger) -> R;
    fn with_logger_mut<F, R>(&mut self, f: F) -> R
       where F: FnOnce(&mut Logger) -> R;

    // Provided methods
    fn set_logging_name(&mut self, name: &str) { ... }
    fn get_logging_name(&mut self) -> Option<String> { ... }
    fn enable_logging(&mut self) { ... }
    fn disable_logging(&mut self) { ... }
    fn is_logging_enabled(&self) -> bool { ... }
}
Available on crate feature logging only.
Expand description

Trait implemented by dnet transports that support logging.

Required Associated Constants§

Source

const KIND: &'static str

Short human-readable type of dnet the transport.

Required Methods§

Source

fn with_logger<F, R>(&self, f: F) -> R
where F: FnOnce(&Logger) -> R,

Execute closure with transport’s logger.

Source

fn with_logger_mut<F, R>(&mut self, f: F) -> R
where F: FnOnce(&mut Logger) -> R,

Execute closure with transport’s logger (mutable).

Provided Methods§

Source

fn set_logging_name(&mut self, name: &str)

Set transport name (for logging purposed).

Source

fn get_logging_name(&mut self) -> Option<String>

Get transport name (for logging purposed).

Source

fn enable_logging(&mut self)

Enable logging for this transport.

Source

fn disable_logging(&mut self)

Disable logging for this transport.

Source

fn is_logging_enabled(&self) -> bool

Is logging enabled for this transport.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§