pub trait Source<Unit>: Sized {
// Required methods
fn read(&mut self, unit: &mut Unit) -> bool;
fn is_exhausted(&self) -> bool;
}Expand description
Trait for a source that provides rANS units to the decoder.
Equivalent to the operator(unit_t&) call on the C++ source type,
simplified to a bool return since the decoder uses boolean outcomes.
Required Methods§
Sourcefn read(&mut self, unit: &mut Unit) -> bool
fn read(&mut self, unit: &mut Unit) -> bool
Read the next unit from the source.
Returns true if a unit was available, false if exhausted.
Sourcefn is_exhausted(&self) -> bool
fn is_exhausted(&self) -> bool
Check whether the source has been fully consumed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".