pub struct NdjsonFileSink { /* private fields */ }Expand description
File sink that writes envelopes as JSON lines to the underlying
MakeWriter. Buffers a Mutex<ErasedWriter> per batch to avoid
re-opening files for every event.
Implementations§
Source§impl NdjsonFileSink
impl NdjsonFileSink
Sourcepub fn new(rolling: RollingFileWriter) -> Self
pub fn new(rolling: RollingFileWriter) -> Self
Build atop RollingFileWriter, the canonical file destination.
Sourcepub fn with_make_writer<M: MakeWriter>(mw: M) -> Self
pub fn with_make_writer<M: MakeWriter>(mw: M) -> Self
Build atop any MakeWriter (test harness, custom destinations).
Sourcepub fn written_total(&self) -> u64
pub fn written_total(&self) -> u64
Total events written successfully.
Trait Implementations§
Source§impl Debug for NdjsonFileSink
impl Debug for NdjsonFileSink
Source§impl Sink for NdjsonFileSink
impl Sink for NdjsonFileSink
Source§fn deliver(&self, env: ScrubbedEnvelope<'_>)
fn deliver(&self, env: ScrubbedEnvelope<'_>)
Hand the envelope to the sink. Must not block; long IO is
queued internally. Spec 11 § 4 / spec 14 § 5.
Auto Trait Implementations§
impl !Freeze for NdjsonFileSink
impl !RefUnwindSafe for NdjsonFileSink
impl Send for NdjsonFileSink
impl Sync for NdjsonFileSink
impl Unpin for NdjsonFileSink
impl UnsafeUnpin for NdjsonFileSink
impl !UnwindSafe for NdjsonFileSink
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