pub struct FileWriter {
pub json_format: bool,
/* private fields */
}Fields§
§json_format: boolImplementations§
Source§impl FileWriter
impl FileWriter
Sourcepub fn new(
trader_id: String,
instance_id: String,
file_config: FileWriterConfig,
fileout_level: LevelFilter,
clear_log_file: bool,
sync_on_flush: bool,
) -> Option<Self>
pub fn new( trader_id: String, instance_id: String, file_config: FileWriterConfig, fileout_level: LevelFilter, clear_log_file: bool, sync_on_flush: bool, ) -> Option<Self>
Creates a new FileWriter instance.
Sourcepub fn flush_buffer(&mut self) -> Result<()>
pub fn flush_buffer(&mut self) -> Result<()>
Flushes the userspace file buffer to the OS.
§Errors
Returns an error if the underlying file buffer cannot be flushed.
Sourcepub fn sync_to_disk(&mut self) -> Result<()>
pub fn sync_to_disk(&mut self) -> Result<()>
Requests that flushed file data is synchronized to durable storage.
§Errors
Returns an error if the operating system cannot sync the file to disk.
Sourcepub fn flush_and_sync(&mut self) -> Result<()>
pub fn flush_and_sync(&mut self) -> Result<()>
Flushes buffered file data and then syncs it to disk.
§Errors
Returns an error if either flushing the file buffer or syncing the file to disk fails.
Sourcepub fn flush_and_sync_logged(&mut self)
pub fn flush_and_sync_logged(&mut self)
Flushes and syncs while preserving the existing logging-on-error behavior.
Trait Implementations§
Source§impl Debug for FileWriter
impl Debug for FileWriter
Auto Trait Implementations§
impl Freeze for FileWriter
impl RefUnwindSafe for FileWriter
impl Send for FileWriter
impl Sync for FileWriter
impl Unpin for FileWriter
impl UnsafeUnpin for FileWriter
impl UnwindSafe for FileWriter
Blanket Implementations§
impl<T> Allocation for T
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