pub struct ChannelLogger { /* private fields */ }
Expand description
Logger implementation that sends log records via an asynchronous channel.
This implementation of the Logger
trait sends log records (Record
) using the sending-half of an underlying
asynchronous channel. You can obtain the receiving-half of the channel using the take_receiver
and
take_receiver_unchecked
methods.
Implementations§
Source§impl ChannelLogger
impl ChannelLogger
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new instance of ChannelLogger
.
Sourcepub fn take_receiver(&mut self) -> Option<Receiver<Record>>
pub fn take_receiver(&mut self) -> Option<Receiver<Record>>
Take channel receiving-half. Returns None
if it was already taken.
Sourcepub fn take_receiver_unchecked(&mut self) -> Receiver<Record>
pub fn take_receiver_unchecked(&mut self) -> Receiver<Record>
Take channel receiving-half. Panics if it was already taken.
Trait Implementations§
Source§impl Debug for ChannelLogger
impl Debug for ChannelLogger
Source§impl Default for ChannelLogger
impl Default for ChannelLogger
Auto Trait Implementations§
impl Freeze for ChannelLogger
impl RefUnwindSafe for ChannelLogger
impl Send for ChannelLogger
impl !Sync for ChannelLogger
impl Unpin for ChannelLogger
impl UnwindSafe for ChannelLogger
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