pub struct CsvExporter { /* private fields */ }Expand description
Appends StatsSnapshots as CSV rows to a file.
Implementations§
Source§impl CsvExporter
impl CsvExporter
Sourcepub fn new(path: impl AsRef<Path>) -> Self
pub fn new(path: impl AsRef<Path>) -> Self
Create a new CsvExporter targeting the given file. The file and its header are created on first write if not present.
Sourcepub fn emit(&self, snapshot: &StatsSnapshot) -> Result<()>
pub fn emit(&self, snapshot: &StatsSnapshot) -> Result<()>
Append a single StatsSnapshot row to the CSV file. Writes the CSV header if the file is newly created.
Auto Trait Implementations§
impl Freeze for CsvExporter
impl RefUnwindSafe for CsvExporter
impl Send for CsvExporter
impl Sync for CsvExporter
impl Unpin for CsvExporter
impl UnsafeUnpin for CsvExporter
impl UnwindSafe for CsvExporter
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more