pub trait EncodingShape {
type State: Clone + Eq + Hash + Debug + 'static;
// Required methods
fn start() -> Self::State;
fn step(state: &Self::State, byte: u8) -> Option<Self::State>;
fn accepts(state: &Self::State) -> bool;
}Expand description
The byte strings that crate::Deserializable::deserialize reads in full, as a
finite automaton over bytes.
Encodings must be prefix-free, as self-delimiting encodings are: no
accepted string continues into another. Checking a set of encodings costs
time proportional to the number of distinct states reached, so State
should take few values.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".