pub struct Stream<P: Protocol> { /* private fields */ }Expand description
Decoded message stream over the same opaque router and lease.
Implementations§
Source§impl<P: Protocol> Stream<P>
impl<P: Protocol> Stream<P>
Sourcepub async fn send<M: IntoOutboundMessage<P>>(
&self,
message: M,
) -> ClientResult<()>
pub async fn send<M: IntoOutboundMessage<P>>( &self, message: M, ) -> ClientResult<()>
Send a native or already-encoded payload using the selected codec.
Sourcepub async fn recv(&mut self) -> ClientResult<Option<Message>>
pub async fn recv(&mut self) -> ClientResult<Option<Message>>
Receive an inspectable message, including unknown names and peer errors.
Sourcepub fn into_parts(self) -> (StreamSender<P>, StreamReceiver<P>)
pub fn into_parts(self) -> (StreamSender<P>, StreamReceiver<P>)
Split into owned handles while preserving one receiver and the ID lease.
Auto Trait Implementations§
impl<P> !RefUnwindSafe for Stream<P>
impl<P> !UnwindSafe for Stream<P>
impl<P> Freeze for Stream<P>
impl<P> Send for Stream<P>
impl<P> Sync for Stream<P>
impl<P> Unpin for Stream<P>
impl<P> UnsafeUnpin for Stream<P>where
RawStream<P>: UnsafeUnpin,
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