use crate::transport::{
error::TransportResult,
protocol::{TransportCommand, TransportEvent},
TransportId, TransportIdRef,
};
use lib3h_protocol::DidWork;
pub trait Transport {
fn connect(&mut self, uri: &str) -> TransportResult<TransportId>;
fn close(&mut self, id: &TransportIdRef) -> TransportResult<()>;
fn close_all(&mut self) -> TransportResult<()>;
fn send(&mut self, id_list: &[&TransportIdRef], payload: &[u8]) -> TransportResult<()>;
fn send_all(&mut self, payload: &[u8]) -> TransportResult<()>;
fn bind(&mut self, url: &str) -> TransportResult<String>;
fn post(&mut self, command: TransportCommand) -> TransportResult<()>;
fn process(&mut self) -> TransportResult<(DidWork, Vec<TransportEvent>)>;
fn transport_id_list(&self) -> TransportResult<Vec<TransportId>>;
fn get_uri(&self, id: &TransportIdRef) -> Option<String>;
}