pub struct JsonlFileSink { /* private fields */ }Implementations§
Source§impl JsonlFileSink
impl JsonlFileSink
Sourcepub async fn open(path: impl AsRef<Path>) -> Result<Self, SinkError>
pub async fn open(path: impl AsRef<Path>) -> Result<Self, SinkError>
Open or create JSONL sink file in append mode. Side effects: filesystem open/create. Complexity: O(1).
Sourcepub async fn open_with_policy(
path: impl AsRef<Path>,
flush_policy: JsonlFlushPolicy,
) -> Result<Self, SinkError>
pub async fn open_with_policy( path: impl AsRef<Path>, flush_policy: JsonlFlushPolicy, ) -> Result<Self, SinkError>
Open JSONL sink with explicit flush policy. Side effects: filesystem open/create. Complexity: O(1).
Trait Implementations§
Source§impl Debug for JsonlFileSink
impl Debug for JsonlFileSink
Source§impl EventSink for JsonlFileSink
impl EventSink for JsonlFileSink
Source§fn on_envelope<'a>(&'a self, envelope: &'a Envelope) -> EventSinkFuture<'a>
fn on_envelope<'a>(&'a self, envelope: &'a Envelope) -> EventSinkFuture<'a>
Serialize one envelope and append a trailing newline. Allocation: one JSON byte vector. Complexity: O(n), n = serialized envelope bytes.
Auto Trait Implementations§
impl Freeze for JsonlFileSink
impl !RefUnwindSafe for JsonlFileSink
impl Send for JsonlFileSink
impl Sync for JsonlFileSink
impl Unpin for JsonlFileSink
impl UnsafeUnpin for JsonlFileSink
impl !UnwindSafe for JsonlFileSink
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