[−][src]Trait twitch_irc::Transport
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.
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]
) -> Pin<Box<dyn Future<Output = Result<Self, Self::ConnectError>> + Send + 'async_trait>> where
Self: 'async_trait,
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).
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>
pub fn new<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<TCPTransport, TCPTransportConnectError>> + Send + 'async_trait>>
[src]
) -> Pin<Box<dyn Future<Output = Result<TCPTransport, TCPTransportConnectError>> + Send + 'async_trait>>
pub fn split(self) -> (Self::Incoming, Self::Outgoing)
[src]
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>
pub fn new<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<WSSTransport, WSError>> + Send + 'async_trait>>
[src]
) -> Pin<Box<dyn Future<Output = Result<WSSTransport, WSError>> + Send + 'async_trait>>