use bytes::{BufMut, Bytes};
pub trait WireEncode {
type Error: std::fmt::Debug + Send + Sync + 'static;
type Context;
fn encoded_len(&self, ctx: &Self::Context) -> usize;
fn encode_to<B: BufMut>(&self, dst: &mut B, ctx: &Self::Context) -> Result<(), Self::Error>;
}
pub trait WireDecode: Sized {
type Error: std::fmt::Debug + Send + Sync + 'static;
type Context;
fn parse<'a>(
input: &'a [u8],
parent: &Bytes,
ctx: &Self::Context,
) -> Result<(&'a [u8], Self), Self::Error>;
}