pub struct AsyncConnection<P: Parcel, S: AsyncRead + AsyncWrite + Send + Unpin> {
pub stream: S,
pub transport: Simple,
pub middleware: Default,
pub settings: Settings,
pub _parcel: PhantomData<P>,
}
Expand description
A stream-based connection.
Fields§
§stream: S
§transport: Simple
§middleware: Default
§settings: Settings
§_parcel: PhantomData<P>
Implementations§
Source§impl<P, S> Connection<P, S>
impl<P, S> Connection<P, S>
Sourcepub async fn receive_packet(&mut self) -> Result<Option<P>, Error>
pub async fn receive_packet(&mut self) -> Result<Option<P>, Error>
Attempts to receive a packet.
pub fn into_inner(self) -> S
Sourcepub fn split(self) -> (ReceiveConnection<P, S>, SendConnection<P, S>)
pub fn split(self) -> (ReceiveConnection<P, S>, SendConnection<P, S>)
Split Connection into ReceiverConnection and SendConnection
Trait Implementations§
Auto Trait Implementations§
impl<P, S> Freeze for Connection<P, S>where
S: Freeze,
impl<P, S> RefUnwindSafe for Connection<P, S>where
S: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, S> Send for Connection<P, S>where
P: Send,
impl<P, S> Sync for Connection<P, S>
impl<P, S> Unpin for Connection<P, S>where
P: Unpin,
impl<P, S> UnwindSafe for Connection<P, S>where
S: UnwindSafe,
P: 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