Struct async_prost::AsyncProstStream [−][src]
A wrapper around an async stream that receives and sends prost-encoded values
Implementations
impl<S, R, W, D> AsyncProstStream<S, R, W, D>[src]
pub fn get_ref(&self) -> &S[src]
Gets a reference to the underlying stream.
It is inadvisable to directly read from or write to the underlying stream.
pub fn get_mut(&mut self) -> &mut S[src]
Gets a mutable reference to the underlying stream.
It is inadvisable to directly read from or write to the underlying stream.
pub fn into_inner(self) -> S[src]
Unwraps this AsyncProstStream, returning the underlying stream.
Note that any leftover serialized data that has not yet been sent, or received data that has not yet been deserialized, is lost.
impl<S, R, W, D> AsyncProstStream<S, R, W, D>[src]
pub fn for_async(self) -> AsyncProstStream<S, R, W, AsyncDestination>[src]
make this stream include the serialized data’s size before each serialized value
pub fn for_async_framed(
self
) -> AsyncProstStream<S, R, W, AsyncFrameDestination>[src]
self
) -> AsyncProstStream<S, R, W, AsyncFrameDestination>
make this stream include the serialized data’s size before each serialized value
pub fn for_sync(self) -> AsyncProstStream<S, R, W, SyncDestination>[src]
Make this stream only send prost-encoded values
impl<R, W, D> AsyncProstStream<TcpStream, R, W, D>[src]
pub fn tcp_split(
&mut self
) -> (AsyncProstReader<ReadHalf<'_>, R, D>, AsyncProstWriter<WriteHalf<'_>, W, D>)[src]
&mut self
) -> (AsyncProstReader<ReadHalf<'_>, R, D>, AsyncProstWriter<WriteHalf<'_>, W, D>)
split a TCP-based stream into a read half and a write half
Trait Implementations
impl<S: Debug, R: Debug, W: Debug, D: Debug> Debug for AsyncProstStream<S, R, W, D>[src]
impl<S, R, W> Default for AsyncProstStream<S, R, W, SyncDestination> where
S: Default, [src]
S: Default,
impl<S, R, W> From<S> for AsyncProstStream<S, R, W, SyncDestination>[src]
impl<S, R, W, D> Sink<W> for AsyncProstStream<S, R, W, D> where
S: Unpin,
AsyncProstWriter<S, W, D>: Sink<W, Error = Error>, [src]
S: Unpin,
AsyncProstWriter<S, W, D>: Sink<W, Error = Error>,
type Error = Error
The type of value produced by the sink when an error occurs.
fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>
fn start_send(self: Pin<&mut Self>, item: W) -> Result<(), Self::Error>[src]
fn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>
fn poll_close(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>
impl<S, R, W, D> Stream for AsyncProstStream<S, R, W, D> where
S: Unpin,
AsyncProstReader<InternalAsyncWriter<S, W, D>, R, D>: Stream<Item = Result<R, Error>>, [src]
S: Unpin,
AsyncProstReader<InternalAsyncWriter<S, W, D>, R, D>: Stream<Item = Result<R, Error>>,
Auto Trait Implementations
impl<S, R, W, D> RefUnwindSafe for AsyncProstStream<S, R, W, D> where
D: RefUnwindSafe,
R: RefUnwindSafe,
S: RefUnwindSafe,
W: RefUnwindSafe,
D: RefUnwindSafe,
R: RefUnwindSafe,
S: RefUnwindSafe,
W: RefUnwindSafe,
impl<S, R, W, D> Send for AsyncProstStream<S, R, W, D> where
D: Send,
R: Send,
S: Send,
W: Send,
D: Send,
R: Send,
S: Send,
W: Send,
impl<S, R, W, D> Sync for AsyncProstStream<S, R, W, D> where
D: Sync,
R: Sync,
S: Sync,
W: Sync,
D: Sync,
R: Sync,
S: Sync,
W: Sync,
impl<S, R, W, D> Unpin for AsyncProstStream<S, R, W, D>
impl<S, R, W, D> UnwindSafe for AsyncProstStream<S, R, W, D> where
D: UnwindSafe,
R: UnwindSafe,
S: UnwindSafe,
W: UnwindSafe,
D: UnwindSafe,
R: UnwindSafe,
S: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<!> for T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<S, T, E> TryStream for S where
S: Stream<Item = Result<T, E>> + ?Sized, [src]
S: Stream<Item = Result<T, E>> + ?Sized,