Trait twitch_irc::transport::Transport
source · 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;
// Required methods
fn new<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<Self, Self::ConnectError>> + Send + 'async_trait>>
where Self: 'async_trait;
fn split(self) -> (Self::Incoming, Self::Outgoing);
}
Expand description
Abstracts over different ways of connecting to Twitch Chat, which are currently plain IRC (TCP), and the Twitch-specific WebSocket extension.
Required Associated Types§
sourcetype ConnectError: Send + Sync + Debug + Display
type ConnectError: Send + Sync + Debug + Display
Error type for creating a new connection via new()
sourcetype IncomingError: Send + Sync + Debug + Display
type IncomingError: Send + Sync + Debug + Display
Error type returned from the Self::Incoming
stream type.
sourcetype OutgoingError: Send + Sync + Debug + Display
type OutgoingError: Send + Sync + Debug + Display
Error type returned from the Self::Outgoing
sink type.
sourcetype Incoming: FusedStream<Item = Result<IRCMessage, Either<Self::IncomingError, IRCParseError>>> + Unpin + Send + Sync
type Incoming: FusedStream<Item = Result<IRCMessage, Either<Self::IncomingError, IRCParseError>>> + Unpin + Send + Sync
Type of stream of incoming messages.
sourcetype Outgoing: Sink<IRCMessage, Error = Self::OutgoingError> + Unpin + Send + Sync
type Outgoing: Sink<IRCMessage, Error = Self::OutgoingError> + Unpin + Send + Sync
Type of outgoing messages sink.