#![cfg(all(feature = "sync", not(any(feature = "tokio", feature = "smol"))))]
pub use datagram::{Anonymous, Repliable};
pub use primary::Primary;
pub use stream::Stream;
mod datagram;
mod primary;
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) -> crate::Result<Self>
where
Self: Sized;
fn write_command(&mut self, command: &[u8]) -> crate::Result<()>;
fn read_command(&mut self) -> crate::Result<String>;
fn create_session(&self) -> SessionParameters;
}
}
pub trait SessionStyle: private::SessionStyle {}
pub trait Subsession: SessionStyle {
fn new(options: crate::options::SessionOptions) -> crate::Result<Self>
where
Self: Sized;
}