#[cfg(feature = "transport-tcp")]
pub mod tcp;
#[cfg(feature = "transport-ws")]
pub mod websocket;
use crate::message::{IRCMessage, IRCParseError};
use async_trait::async_trait;
use either::Either;
use futures_util::{sink::Sink, stream::FusedStream};
use std::fmt::{Debug, Display};
#[async_trait]
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;
async fn new() -> Result<Self, Self::ConnectError>;
fn split(self) -> (Self::Incoming, Self::Outgoing);
}