[][src]Enum tcp_typed::Connection

pub enum Connection {
    Connecter(Connecter),
    Connectee(Connectee),
    ConnecterLocalClosed(ConnecterLocalClosed),
    ConnecteeLocalClosed(ConnecteeLocalClosed),
    Connected(Connected),
    RemoteClosed(RemoteClosed),
    LocalClosed(LocalClosed),
    Closing(Closing),
    Closed,
    Killed,
}

Essentially a dynamically-typed connection, wrapping all of the individual states in an enum and providing methods that are available or not dynamically (by returning an Option<impl FnOnce(..)>).

Variants

Connecter(Connecter)Connectee(Connectee)ConnecterLocalClosed(ConnecterLocalClosed)ConnecteeLocalClosed(ConnecteeLocalClosed)Connected(Connected)RemoteClosed(RemoteClosed)LocalClosed(LocalClosed)Closing(Closing)ClosedKilled

Methods

impl Connection[src]

#[must_use] pub fn connect(
    local: SocketAddr,
    remote: SocketAddr,
    executor: &impl Notifier
) -> Self
[src]

pub fn poll(&mut self, executor: &impl Notifier)[src]

pub fn connecting(&self) -> bool[src]

pub fn recvable(&self) -> bool[src]

pub fn recv_avail(&self) -> Option<usize>[src]

#[must_use] pub fn recv<'a>(
    &'a mut self,
    executor: &'a impl Notifier
) -> Option<impl FnOnce() -> u8 + 'a>
[src]

pub fn sendable(&self) -> bool[src]

pub fn send_avail(&self) -> Option<usize>[src]

#[must_use] pub fn send<'a>(
    &'a mut self,
    executor: &'a impl Notifier
) -> Option<impl FnOnce(u8) + 'a>
[src]

pub fn closed(&self) -> bool[src]

pub fn valid(&self) -> bool[src]

pub fn closable(&self) -> bool[src]

#[must_use] pub fn close<'a>(
    &'a mut self,
    executor: &'a impl Notifier
) -> Option<impl FnOnce() + 'a>
[src]

pub fn killable(&self) -> bool[src]

#[must_use] pub fn kill<'a>(
    &'a mut self,
    executor: &'a impl Notifier
) -> Option<impl FnOnce() + 'a>
[src]

Trait Implementations

impl From<Connecter> for Connection[src]

impl From<ConnecterPoll> for Connection[src]

impl From<Connectee> for Connection[src]

impl From<ConnecteePoll> for Connection[src]

impl From<ConnecterLocalClosed> for Connection[src]

impl From<ConnecterLocalClosedPoll> for Connection[src]

impl From<ConnecteeLocalClosed> for Connection[src]

impl From<ConnecteeLocalClosedPoll> for Connection[src]

impl From<Connected> for Connection[src]

impl From<ConnectedPoll> for Connection[src]

impl From<RemoteClosed> for Connection[src]

impl From<RemoteClosedPoll> for Connection[src]

impl From<LocalClosed> for Connection[src]

impl From<LocalClosedPoll> for Connection[src]

impl From<Closing> for Connection[src]

impl From<ClosingPoll> for Connection[src]

impl Debug for Connection[src]

Auto Trait Implementations

Blanket Implementations

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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self