[][src]Struct protocol::wire::stream::Connection

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>,
}

A stream-based connection.

Fields

stream: Stransport: Simplemiddleware: Msettings: Settings_a: PhantomData<P>

Implementations

impl<P, S, M> Connection<P, S, M> where
    P: Parcel,
    S: Read + Write,
    M: Pipeline
[src]

pub fn new(stream: S, middleware: M, settings: Settings) -> Self[src]

Creates a new connection.

pub fn process_incoming_data(&mut self) -> Result<(), Error>[src]

Processes any incoming data in the stream.

pub fn receive_packet(&mut self) -> Result<Option<P>, Error>[src]

Attempts to receive a packet.

pub 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 + Read + Write, M: Debug + Pipeline> Debug for Connection<P, S, M>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.