pub struct FnHandler<F>(pub F);Expand description
Dispatches every event to a user-supplied closure. The closure receives
the level via event.level.
Tuple Fields§
§0: FTrait Implementations§
Source§impl<F> WatermarkHandler for FnHandler<F>
impl<F> WatermarkHandler for FnHandler<F>
Source§fn on_warn(&self, event: WatermarkEvent)
fn on_warn(&self, event: WatermarkEvent)
Called once per crossing of the
warn_pct threshold (rising edge).Source§fn on_critical(&self, event: WatermarkEvent)
fn on_critical(&self, event: WatermarkEvent)
Called once per crossing of the
critical_pct threshold (rising edge).Source§fn on_oom(&self, event: WatermarkEvent)
fn on_oom(&self, event: WatermarkEvent)
Called when an allocation returns
AllocError.Auto Trait Implementations§
impl<F> Freeze for FnHandler<F>where
F: Freeze,
impl<F> RefUnwindSafe for FnHandler<F>where
F: RefUnwindSafe,
impl<F> Send for FnHandler<F>where
F: Send,
impl<F> Sync for FnHandler<F>where
F: Sync,
impl<F> Unpin for FnHandler<F>where
F: Unpin,
impl<F> UnsafeUnpin for FnHandler<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FnHandler<F>where
F: UnwindSafe,
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