pub struct TraceWriter { /* private fields */ }
Implementations§
Source§impl TraceWriter
impl TraceWriter
Sourcepub fn new<W: Write + Send + 'static>(writer: W) -> (Self, TraceWriterGuard)
pub fn new<W: Write + Send + 'static>(writer: W) -> (Self, TraceWriterGuard)
This is a non-blocking writer that writes a file in a background thread. This is inspired by tracing-appender non_blocking, but has some differences:
- It allows writing an owned Vec
instead of a reference, so avoiding additional allocation. - It uses an unbounded channel to avoid slowing down the application at all (memory) cost.
- It issues less writes by buffering the data into chunks of WRITE_BUFFER_SIZE, when possible.
pub fn start_write(&self) -> WriteGuard<'_>
Trait Implementations§
Source§impl Clone for TraceWriter
impl Clone for TraceWriter
Source§fn clone(&self) -> TraceWriter
fn clone(&self) -> TraceWriter
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for TraceWriter
impl RefUnwindSafe for TraceWriter
impl Send for TraceWriter
impl Sync for TraceWriter
impl Unpin for TraceWriter
impl UnwindSafe for TraceWriter
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