http_wire/lib.rs
1use bytes::Bytes;
2use std::future::Future;
3
4mod error;
5pub mod request;
6pub mod response;
7mod util;
8mod wire;
9
10pub use error::WireError;
11
12pub trait WireEncode {
13 fn encode(self) -> impl Future<Output = Result<Bytes, WireError>> + Send;
14}
15
16pub trait WireDecode: Sized {
17 type Output;
18 fn decode(bytes: &[u8]) -> Option<Self::Output>;
19}