pub struct Connection<T> { /* private fields */ }Implementations§
Source§impl<T: AsyncRead + AsyncWrite + Send + Unpin + 'static> Connection<T>
impl<T: AsyncRead + AsyncWrite + Send + Unpin + 'static> Connection<T>
Sourcepub async fn next_stream(&mut self) -> Result<(), ConnectionError>
pub async fn next_stream(&mut self) -> Result<(), ConnectionError>
Get the next incoming stream, opened by the remote.
This must be called repeatedly in order to make progress.
Once Ok(())) or Err(_) is returned the connection is
considered closed and no further invocation of this method
must be attempted.
Sourcepub async fn handle_coming(&mut self) -> Result<(), ConnectionError>
pub async fn handle_coming(&mut self) -> Result<(), ConnectionError>
This is called from Connection::next_stream instead of being a
public method itself in order to guarantee proper closing in
case of an error or at EOF.
Source§impl<T> Connection<T>
impl<T> Connection<T>
pub fn streams_length(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Connection<T>
impl<T> !RefUnwindSafe for Connection<T>
impl<T> Send for Connection<T>where
T: Send,
impl<T> !Sync for Connection<T>
impl<T> Unpin for Connection<T>
impl<T> !UnwindSafe for Connection<T>
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