pub struct Connection<P: Parcel, S: Read + Write, M: Pipeline = Default> {
pub stream: S,
pub transport: Simple,
pub middleware: M,
pub settings: Settings,
pub _a: PhantomData<P>,
}Expand description
A stream-based connection.
Fields§
§stream: S§transport: Simple§middleware: M§settings: Settings§_a: PhantomData<P>Implementations§
Source§impl<P, S, M> Connection<P, S, M>
impl<P, S, M> Connection<P, S, M>
Sourcepub fn process_incoming_data(&mut self) -> Result<(), Error>
pub fn process_incoming_data(&mut self) -> Result<(), Error>
Processes any incoming data in the stream.
Sourcepub fn receive_packet(&mut self) -> Result<Option<P>, Error>
pub fn receive_packet(&mut self) -> Result<Option<P>, Error>
Attempts to receive a packet.
pub fn into_inner(self) -> S
Trait Implementations§
Auto Trait Implementations§
impl<P, S, M> Freeze for Connection<P, S, M>
impl<P, S, M> RefUnwindSafe for Connection<P, S, M>
impl<P, S, M> Send for Connection<P, S, M>
impl<P, S, M> Sync for Connection<P, S, M>
impl<P, S, M> Unpin for Connection<P, S, M>
impl<P, S, M> UnwindSafe for Connection<P, S, M>
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