#![cfg(all(feature = "async", not(feature = "sync")))]
pub use datagram::{Anonymous, Repliable};
pub use stream::Stream;
mod datagram;
mod stream;
pub(crate) mod private {
pub struct SessionParameters {
pub(crate) style: String,
pub(crate) options: Vec<(String, String)>,
}
pub trait SessionStyle {
fn new(
options: crate::options::SessionOptions,
) -> impl std::future::Future<Output = crate::Result<Self>>
where
Self: Sized;
fn write_command(
&mut self,
command: &[u8],
) -> impl std::future::Future<Output = crate::Result<()>>;
fn read_command(&mut self) -> impl std::future::Future<Output = crate::Result<String>>;
fn create_session(&self) -> SessionParameters;
}
}
pub trait SessionStyle: private::SessionStyle {}