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>
impl<T: ReaderTransport> AsyncInventorySession<T>
Sourcepub async fn recv(
&mut self,
) -> Result<AsyncInventoryMessage, ClientError<T::Error>>
pub async fn recv( &mut self, ) -> Result<AsyncInventoryMessage, ClientError<T::Error>>
Receive one pushed asynchronous inventory message from the reader.
Sourcepub async fn stop(self) -> Result<SilionReader<T>, ClientError<T::Error>>
pub async fn stop(self) -> Result<SilionReader<T>, ClientError<T::Error>>
Send 0xAA49, wait for StopAck, and recover the reader.
Sourcepub async fn stop_no_wait(
self,
) -> Result<SilionReader<T>, ClientError<T::Error>>
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> 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