pub struct CallbackSink { /* private fields */ }Expand description
Hands every record line to a callback. A panic in the callback is caught, counted and disables the sink, so it never fails the run. Input: lines. Output: calls to the callback.
Implementations§
Source§impl CallbackSink
impl CallbackSink
Sourcepub fn new(callback: impl Fn(&str) + Send + Sync + 'static) -> CallbackSink
pub fn new(callback: impl Fn(&str) + Send + Sync + 'static) -> CallbackSink
Returns a sink that calls callback with each line.
Input: the callback. Output: the sink.
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Returns whether a panic disabled the sink. Input: none.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CallbackSink
impl !RefUnwindSafe for CallbackSink
impl !UnwindSafe for CallbackSink
impl Forget for CallbackSink
impl Move for CallbackSink
impl Send for CallbackSink
impl Sync for CallbackSink
impl Unpin for CallbackSink
impl UnsafeUnpin for CallbackSinkwhere
*const dyn Fn(&str) + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Fn(&str) + Sync + Send>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
Align8<u64>: UnsafeUnpin,
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