PSArc_lib/traits/parse_context.rs
1use crate::traits::ConvertAsBytes;
2
3/// **ParsableContext** means that the item is parsable from raw bytes to itself with a self context
4pub trait ParsableContext {
5 /// **Error** should be whatever your return error type is
6 type Error;
7 /// **parse** converts raw bytes to itself
8 fn parse(&mut self, bytes: impl ConvertAsBytes) -> Result<Self, Self::Error> where Self: Sized;
9}