[−][src]Struct async_protocol::AsyncConnection
A stream-based connection.
Fields
stream: Stransport: Simplemiddleware: Defaultsettings: Settings_parcel: PhantomData<P>Implementations
impl<P, S> Connection<P, S> where
P: Parcel,
S: AsyncRead + AsyncWrite + Send + Unpin, [src]
P: Parcel,
S: AsyncRead + AsyncWrite + Send + Unpin,
pub fn new(stream: S, settings: Settings) -> Self[src]
Creates a new connection.
pub async fn receive_packet(&mut self) -> Result<Option<P>, Error>[src]
Attempts to receive a packet.
pub async fn send_packet(&mut self, packet: &P) -> Result<(), Error>[src]
Sends a packet.
pub fn into_inner(self) -> S[src]
Trait Implementations
impl<P: Debug + Parcel, S: Debug + AsyncRead + AsyncWrite + Send + Unpin> Debug for Connection<P, S>[src]
Auto Trait Implementations
impl<P, S> RefUnwindSafe for Connection<P, S> where
P: RefUnwindSafe,
S: RefUnwindSafe, [src]
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S> Send for Connection<P, S> where
P: Send, [src]
P: Send,
impl<P, S> Sync for Connection<P, S> where
P: Sync,
S: Sync, [src]
P: Sync,
S: Sync,
impl<P, S> Unpin for Connection<P, S> where
P: Unpin, [src]
P: Unpin,
impl<P, S> UnwindSafe for Connection<P, S> where
P: UnwindSafe,
S: UnwindSafe, [src]
P: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,