pub struct NativeStream<C: StreamCapability> { /* private fields */ }Expand description
One opened, typed bidirectional stream session.
Implementations§
Source§impl<C: StreamCapability> NativeStream<C>
impl<C: StreamCapability> NativeStream<C>
Sourcepub async fn send(&self, message: C::Message) -> Result<(), RuntimeFailure>
pub async fn send(&self, message: C::Message) -> Result<(), RuntimeFailure>
Sends one typed message to the remote side.
Sourcepub async fn receive(
&self,
) -> Result<StreamEvent<C::Message, C::DomainError>, RuntimeFailure>
pub async fn receive( &self, ) -> Result<StreamEvent<C::Message, C::DomainError>, RuntimeFailure>
Receives the next ordered event from the remote side.
Sourcepub async fn close_send(&self) -> Result<(), RuntimeFailure>
pub async fn close_send(&self) -> Result<(), RuntimeFailure>
Closes this side’s sending direction while keeping receiving available.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Cancels the stream idempotently. No later frame is delivered to the caller.
Sourcepub const fn request_id(&self) -> RequestId
pub const fn request_id(&self) -> RequestId
Returns the propagated Kernel Request ID for this stream.
Trait Implementations§
Source§impl<C: Debug + StreamCapability> Debug for NativeStream<C>
impl<C: Debug + StreamCapability> Debug for NativeStream<C>
Source§impl<C: StreamCapability> Drop for NativeStream<C>
impl<C: StreamCapability> Drop for NativeStream<C>
Auto Trait Implementations§
impl<C> !Freeze for NativeStream<C>
impl<C> !RefUnwindSafe for NativeStream<C>
impl<C> !Send for NativeStream<C>
impl<C> !Sync for NativeStream<C>
impl<C> !UnwindSafe for NativeStream<C>
impl<C> Unpin for NativeStream<C>
impl<C> UnsafeUnpin for NativeStream<C>
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