[][src]Trait twitch_irc::Transport

pub trait Transport: Sized + Send + Sync + Debug + 'static {
    type ConnectError: Send + Sync + Debug + Display;
    type IncomingError: Send + Sync + Debug + Display;
    type OutgoingError: Send + Sync + Debug + Display;
    type Incoming: FusedStream<Item = Result<IRCMessage, Either<Self::IncomingError, IRCParseError>>> + Unpin + Send + Sync;
    type Outgoing: Sink<IRCMessage, Error = Self::OutgoingError> + Unpin + Send + Sync;
#[must_use]    pub fn new<'async_trait>(
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::ConnectError>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
pub fn split(self) -> (Self::Incoming, Self::Outgoing); }

Abstracts over different ways of connecting to Twitch Chat, which are currently plain IRC (TCP), and the Twitch-specific WebSocket extension.

Associated Types

type ConnectError: Send + Sync + Debug + Display[src]

Error type for creating a new connection via new()

type IncomingError: Send + Sync + Debug + Display[src]

Error type returned from the Self::Incoming stream type.

type OutgoingError: Send + Sync + Debug + Display[src]

Error type returned from the Self::Outgoing sink type.

type Incoming: FusedStream<Item = Result<IRCMessage, Either<Self::IncomingError, IRCParseError>>> + Unpin + Send + Sync[src]

Type of stream of incoming messages.

type Outgoing: Sink<IRCMessage, Error = Self::OutgoingError> + Unpin + Send + Sync[src]

Type of outgoing messages sink.

Loading content...

Required methods

#[must_use]pub fn new<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<Self, Self::ConnectError>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Try to create and connect a new Transport of this type. Returns Ok(Self) after the connection was established successfully.

pub fn split(self) -> (Self::Incoming, Self::Outgoing)[src]

Split this transport into its incoming and outgoing halves (streams).

Loading content...

Implementors

impl Transport for TCPTransport[src]

type ConnectError = TCPTransportConnectError

type IncomingError = Error

type OutgoingError = Error

type Incoming = Box<dyn FusedStream<Item = Result<IRCMessage, Either<Error, IRCParseError>>> + Unpin + Send + Sync>

type Outgoing = Box<dyn Sink<IRCMessage, Error = Self::OutgoingError> + Unpin + Send + Sync>

impl Transport for WSSTransport[src]

type ConnectError = WSError

type IncomingError = WSError

type OutgoingError = WSError

type Incoming = Box<dyn FusedStream<Item = Result<IRCMessage, Either<WSError, IRCParseError>>> + Unpin + Send + Sync>

type Outgoing = Box<dyn Sink<IRCMessage, Error = Self::OutgoingError> + Unpin + Send + Sync>

Loading content...