Skip to main content

AsyncInventorySession

Struct AsyncInventorySession 

Source
pub struct AsyncInventorySession<T: ReaderTransport> { /* private fields */ }
Expand description

An active asynchronous inventory session driven by awaited reads.

Created by SilionReader::into_async_session. The transport is moved into this session for the duration of asynchronous inventory, and no other commands can be sent until stop is called and the transport is recovered as a SilionReader.

Implementations§

Source§

impl<T: ReaderTransport> AsyncInventorySession<T>

Source

pub async fn recv( &mut self, ) -> Result<AsyncInventoryMessage, ClientError<T::Error>>

Receive one pushed asynchronous inventory message from the reader.

Source

pub async fn stop(self) -> Result<SilionReader<T>, ClientError<T::Error>>

Send 0xAA49, wait for StopAck, and recover the reader.

Source

pub async fn stop_no_wait( self, ) -> Result<SilionReader<T>, ClientError<T::Error>>

Send 0xAA49 and recover the host without waiting for StopAck.

This is useful for environments where an in-flight async receive was canceled and waiting for the acknowledgement could otherwise block indefinitely.

Auto Trait Implementations§

§

impl<T> Freeze for AsyncInventorySession<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for AsyncInventorySession<T>
where T: RefUnwindSafe,

§

impl<T> Send for AsyncInventorySession<T>
where T: Send,

§

impl<T> Sync for AsyncInventorySession<T>
where T: Sync,

§

impl<T> Unpin for AsyncInventorySession<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for AsyncInventorySession<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for AsyncInventorySession<T>
where T: UnwindSafe,

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 = Infallible

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.