pub struct JsonLogBackend<W: Write + Send + 'static> { /* private fields */ }Expand description
One JSON object per line (serde_json), for files or test buffers.
Implementations§
Source§impl<W: Write + Send + 'static> JsonLogBackend<W>
impl<W: Write + Send + 'static> JsonLogBackend<W>
Sourcepub fn new(writer: W) -> Self
pub fn new(writer: W) -> Self
Wrap writer; each LogBackend::emit appends one JSON object and newline.
Sourcepub fn writer_arc(&self) -> Arc<Mutex<W>>
pub fn writer_arc(&self) -> Arc<Mutex<W>>
Clone the shared writer handle (e.g. read back a test Vec<u8> after logging).
Trait Implementations§
Source§impl<W: Clone + Write + Send + 'static> Clone for JsonLogBackend<W>
impl<W: Clone + Write + Send + 'static> Clone for JsonLogBackend<W>
Source§fn clone(&self) -> JsonLogBackend<W>
fn clone(&self) -> JsonLogBackend<W>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<W: Write + Send + 'static> LogBackend for JsonLogBackend<W>
impl<W: Write + Send + 'static> LogBackend for JsonLogBackend<W>
Auto Trait Implementations§
impl<W> Freeze for JsonLogBackend<W>
impl<W> RefUnwindSafe for JsonLogBackend<W>
impl<W> Send for JsonLogBackend<W>
impl<W> Sync for JsonLogBackend<W>
impl<W> Unpin for JsonLogBackend<W>
impl<W> UnsafeUnpin for JsonLogBackend<W>
impl<W> UnwindSafe for JsonLogBackend<W>
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