use crate::Result; pub trait DataPollResult { fn data(&self) -> &[u8]; } pub trait DataCompletion { type DataPollResult: DataPollResult; fn status(&self) -> Result>; fn poll_data(&self) -> Result>; fn is_done(&self) -> Result; } pub trait ProtocolIO { type DataCompletion: DataCompletion; fn full_read(&self, path: &str) -> Result; fn full_write(&self, path: &str, content: Vec) -> Result; fn http(&self, method: &str, path: &str, body: Option>) -> Result; }