pub struct TraceWriter { /* private fields */ }Expand description
Appends records to a trace file. Not Sync; a profiler must serialize
writes (the profiler’s sink mutex does this).
Implementations§
Source§impl TraceWriter
impl TraceWriter
Sourcepub fn create(path: &Path, header: &TraceHeader) -> Result<Self>
pub fn create(path: &Path, header: &TraceHeader) -> Result<Self>
Create (truncate) a trace file and write the header.
Sourcepub fn write(&mut self, record: &TraceRecord) -> Result<()>
pub fn write(&mut self, record: &TraceRecord) -> Result<()>
Append one record.
Sourcepub fn write_event(&mut self, event: &TraceEvent) -> Result<()>
pub fn write_event(&mut self, event: &TraceEvent) -> Result<()>
Append one event.
Sourcepub fn flush_buffered(&mut self) -> Result<()>
pub fn flush_buffered(&mut self) -> Result<()>
Flush buffered bytes to the file without finishing the session.
Sourcepub fn finish(&mut self, summary: &TraceSummary) -> Result<()>
pub fn finish(&mut self, summary: &TraceSummary) -> Result<()>
Write the session summary and flush. The file is left open for
inspection; call close to release it.
Auto Trait Implementations§
impl Freeze for TraceWriter
impl RefUnwindSafe for TraceWriter
impl Send for TraceWriter
impl Sync for TraceWriter
impl Unpin for TraceWriter
impl UnsafeUnpin 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