pub struct AsyncSession<S> { /* private fields */ }Expand description
Async equivalent of Session. Wrap establishment in one timeout. Cancelling
a frame read or write poisons the session; it cannot resume on a byte prefix.
Implementations§
Source§impl<S: AsyncRead + AsyncWrite + Unpin> AsyncSession<S>
impl<S: AsyncRead + AsyncWrite + Unpin> AsyncSession<S>
Sourcepub async fn connect(io: S, offer: &Hello) -> Result<Self>
pub async fn connect(io: S, offer: &Hello) -> Result<Self>
Establish a client session on an advertised binary endpoint.
Sourcepub async fn accept(io: S, offer: &Hello) -> Result<Self>
pub async fn accept(io: S, offer: &Hello) -> Result<Self>
Establish a server session after the caller has authenticated the peer.
Sourcepub async fn refuse(io: S, offer: &Hello, reason: Refused) -> Result<()>
pub async fn refuse(io: S, offer: &Hello, reason: Refused) -> Result<()>
Async equivalent of Session::refuse.
Auto Trait Implementations§
impl<S> Freeze for AsyncSession<S>where
S: Freeze,
impl<S> RefUnwindSafe for AsyncSession<S>where
S: RefUnwindSafe,
impl<S> Send for AsyncSession<S>where
S: Send,
impl<S> Sync for AsyncSession<S>where
S: Sync,
impl<S> Unpin for AsyncSession<S>where
S: Unpin,
impl<S> UnsafeUnpin for AsyncSession<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for AsyncSession<S>where
S: 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