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
sourceimpl<P, S, M> Connection<P, S, M> where
P: Parcel,
S: Read + Write,
M: Pipeline,
impl<P, S, M> Connection<P, S, M> where
P: Parcel,
S: Read + Write,
M: Pipeline,
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> RefUnwindSafe for Connection<P, S, M> where
M: RefUnwindSafe,
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S, M> Send for Connection<P, S, M> where
M: Send,
P: Send,
S: Send,
impl<P, S, M> Sync for Connection<P, S, M> where
M: Sync,
P: Sync,
S: Sync,
impl<P, S, M> Unpin for Connection<P, S, M> where
M: Unpin,
P: Unpin,
S: Unpin,
impl<P, S, M> UnwindSafe for Connection<P, S, M> where
M: UnwindSafe,
P: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more