Skip to main content

NativeStream

Struct NativeStream 

Source
pub struct NativeStream<C: StreamCapability> { /* private fields */ }
Expand description

One opened, typed bidirectional stream session.

Implementations§

Source§

impl<C: StreamCapability> NativeStream<C>

Source

pub async fn send(&self, message: C::Message) -> Result<(), RuntimeFailure>

Sends one typed message to the remote side.

Source

pub async fn receive( &self, ) -> Result<StreamEvent<C::Message, C::DomainError>, RuntimeFailure>

Receives the next ordered event from the remote side.

Source

pub async fn close_send(&self) -> Result<(), RuntimeFailure>

Closes this side’s sending direction while keeping receiving available.

Source

pub fn cancel(&self)

Cancels the stream idempotently. No later frame is delivered to the caller.

Source

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>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C: StreamCapability> Drop for NativeStream<C>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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>
where PhantomData<fn() -> C>: Unpin,

§

impl<C> UnsafeUnpin for NativeStream<C>
where PhantomData<fn() -> C>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.