Struct async_prost::AsyncProstStream[][src]

pub struct AsyncProstStream<S, R, W, D> { /* fields omitted */ }

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]

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]

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]

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]

type Error = Error

The type of value produced by the sink when an error occurs.

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]

type Item = Result<R, Error>

Values yielded by the stream.

Auto Trait Implementations

impl<S, R, W, D> RefUnwindSafe for AsyncProstStream<S, R, W, D> where
    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

impl<S, R, W, D> Sync for AsyncProstStream<S, R, W, D> where
    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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[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]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future