pub struct JsonLinesSink<W, T> { /* private fields */ }
Available on crate feature
async
only.Expand description
An asynchronous sink that serializes input values of type T
as JSON
and writes them to the underlying AsyncWrite
value W
.
Sinks of this type are returned by
AsyncJsonLinesWriter::into_sink()
and
AsyncWriteJsonLines::into_json_lines_sink()
.
Trait Implementations§
Source§impl<W: Clone, T: Clone> Clone for JsonLinesSink<W, T>
impl<W: Clone, T: Clone> Clone for JsonLinesSink<W, T>
Source§fn clone(&self) -> JsonLinesSink<W, T>
fn clone(&self) -> JsonLinesSink<W, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<W: AsyncWrite, T> Sink<T> for JsonLinesSink<W, T>where
T: Serialize,
impl<W: AsyncWrite, T> Sink<T> for JsonLinesSink<W, T>where
T: Serialize,
Source§fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Attempts to prepare the
Sink
to receive a value. Read moreSource§fn start_send(self: Pin<&mut Self>, item: T) -> Result<()>
fn start_send(self: Pin<&mut Self>, item: T) -> Result<()>
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready
which returned Poll::Ready(Ok(()))
. Read moreimpl<W: Eq, T: Eq> Eq for JsonLinesSink<W, T>
impl<W, T> StructuralPartialEq for JsonLinesSink<W, T>
impl<'__pin, W, T> Unpin for JsonLinesSink<W, T>where
__Origin<'__pin, W, T>: Unpin,
Auto Trait Implementations§
impl<W, T> Freeze for JsonLinesSink<W, T>where
W: Freeze,
impl<W, T> RefUnwindSafe for JsonLinesSink<W, T>where
W: RefUnwindSafe,
T: RefUnwindSafe,
impl<W, T> Send for JsonLinesSink<W, T>
impl<W, T> Sync for JsonLinesSink<W, T>
impl<W, T> UnwindSafe for JsonLinesSink<W, T>where
W: UnwindSafe,
T: UnwindSafe,
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