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§
Required Methods§
Sourcefn with_logger<F, R>(&self, f: F) -> R
fn with_logger<F, R>(&self, f: F) -> R
Execute closure with transport’s logger.
Sourcefn with_logger_mut<F, R>(&mut self, f: F) -> R
fn with_logger_mut<F, R>(&mut self, f: F) -> R
Execute closure with transport’s logger (mutable).
Provided Methods§
Sourcefn set_logging_name(&mut self, name: &str)
fn set_logging_name(&mut self, name: &str)
Set transport name (for logging purposed).
Sourcefn get_logging_name(&mut self) -> Option<String>
fn get_logging_name(&mut self) -> Option<String>
Get transport name (for logging purposed).
Sourcefn enable_logging(&mut self)
fn enable_logging(&mut self)
Enable logging for this transport.
Sourcefn disable_logging(&mut self)
fn disable_logging(&mut self)
Disable logging for this transport.
Sourcefn is_logging_enabled(&self) -> bool
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".