pub trait FromBits {
type Symbol;
// Required method
fn from_bits<F, E>(next: F) -> Result<Self::Symbol, E>
where F: FnMut() -> Result<bool, E>;
}Expand description
A trait for building a final value from individual bits
Though similar to the crate::read::FromBitStream trait,
this is intended to parse short symbols from a stream of bits
while FromBitStream is meant for parsing larger structs from
a whole reader.
For example, one might have several FromBits implementations
in a single program that all generate i32 symbols from bits,
but implementing FromBitStream multiple times for i32
isn’t possible (or practical).
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.