pub struct FileBackendBuilder { /* private fields */ }Expand description
Builder for FileBackend.
Implementations§
Source§impl FileBackendBuilder
impl FileBackendBuilder
Sourcepub const fn rotation(self, rotation: RotationPolicy) -> Self
pub const fn rotation(self, rotation: RotationPolicy) -> Self
Set when to rotate. Defaults to never.
Sourcepub const fn sync_on_write(self, sync: bool) -> Self
pub const fn sync_on_write(self, sync: bool) -> Self
fsync after every event.
Without this an event survives a process crash but not a power loss. With it, throughput drops by roughly an order of magnitude.
Sourcepub fn errors(self, errors: Arc<dyn ErrorSink>) -> Self
pub fn errors(self, errors: Arc<dyn ErrorSink>) -> Self
Where to report writes that fail. Defaults to discarding them.
Sourcepub fn build(self) -> Result<FileBackend>
pub fn build(self) -> Result<FileBackend>
Open the file.
§Errors
Returns the underlying error if the path cannot be created or opened for appending.
Auto Trait Implementations§
impl !RefUnwindSafe for FileBackendBuilder
impl !UnwindSafe for FileBackendBuilder
impl Forget for FileBackendBuilder
impl Freeze for FileBackendBuilder
impl Move for FileBackendBuilder
impl Send for FileBackendBuilder
impl Sync for FileBackendBuilder
impl Unpin for FileBackendBuilder
impl UnsafeUnpin for FileBackendBuilder
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