pub struct LogHandler {
pub callback: Arc<dyn Fn(LogSeverity, LogEvent, i64, &str) + Send + Sync + 'static>,
pub platform_severities: LogSeverityFlag,
}Expand description
A log callback, for set_log_callback().
Runs on the thread that logged the message, or on a background thread for
the severities that set_log_async_severity_mask() selects. The callback
can’t call the library.
See mln_log_handler in the
C API reference.
Fields§
§callback: Arc<dyn Fn(LogSeverity, LogEvent, i64, &str) + Send + Sync + 'static>The callback receives (severity, event, code, message).
platform_severities: LogSeverityFlagThe severities that also go to the platform’s log, as they do without a callback. 0 sends none. A message of these severities goes to the platform’s log even when the handler’s queue can’t accept it.
Implementations§
Trait Implementations§
Source§impl Clone for LogHandler
impl Clone for LogHandler
Source§fn clone(&self) -> LogHandler
fn clone(&self) -> LogHandler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for LogHandler
impl !UnwindSafe for LogHandler
impl Freeze for LogHandler
impl Send for LogHandler
impl Sync for LogHandler
impl Unpin for LogHandler
impl UnsafeUnpin for LogHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more