use core::fmt::Debug;
use erased_serde::serialize_trait_object;
use crate::errors::Error;
pub trait Layer: Send + Debug + erased_serde::Serialize {
fn decode_bytes(
&mut self,
bytes: &[u8],
) -> Result<(Option<Box<dyn Layer + Send>>, usize), Error>;
#[cfg(feature = "sculpting")]
fn stack_and_encode(
&mut self,
_next_layer: Option<&[u8]>,
_info: &str,
) -> Result<Vec<u8>, Error> {
unimplemented!()
}
fn name(&self) -> &'static str;
fn short_name(&self) -> &'static str;
}
serialize_trait_object!(Layer);