pub fn iter_compressed<'a>(&'a self) -> impl Iterator<Item = Word> + '_
    where
        &'a Backend: IntoIterator<Item = &'a Word>,
    {
        let bulk_iter = self.bulk.into_iter().cloned();
        let state_iter = bit_array_to_chunks_truncated(self.state).rev();
        bulk_iter.chain(state_iter)
    }
/// Iterates over the compressed data currently on the ans.
///
/// In contrast to [`get_compressed`] or [`into_compressed`], this method does
/// not require mutable access or even ownership of the `AnsCoder`.
///
/// # Example
///
/// ```
/// use constriction::stream::{model::DefaultLeakyQuantizer, stack::DefaultAnsCoder, Decode};
///
/// // Create a stack and encode some stuff.
/// let mut ans = DefaultAnsCoder::new();
/// let symbols = vec![8, -12, 0, 7];
/// let quantizer = DefaultLeakyQuantizer::new(-100..=100);
/// let model =
///     quantizer.quantize(probability::distribution::Gaussian::new(0.0, 10.0));
/// ans.encode_iid_symbols_reverse(&symbols, &model).unwrap();
///
/// // Iterate over compressed data, collect it into to a Vec``, and compare to direct method.
/// let compressed_iter = ans.iter_compressed();
/// let compressed_collected = compressed_iter.collect::<Vec<_>>();
/// assert!(!compressed_collected.is_empty());
/// assert_eq!(compressed_collected, *ans.get_compressed().unwrap());
/// ```
///
/// [`get_compressed`]: #method.get_compressed
/// [`into_compressed`]: #method.into_compressed
Iterates over the compressed data currently on the ans.
Iterates over the compressed data currently on the ans .
pub fn iter_compressed<'a>(&'a self) -> impl Iterator<Item = Word> + '_
    where
        &'a Backend: IntoIterator<Item = &'a Word>,
    {
        let bulk_iter = self.bulk.into_iter().cloned();
        let state_iter = bit_array_to_chunks_truncated(self.state).rev();
        bulk_iter.chain(state_iter)
    }
pub fn iter_compressed < ' a > ( & ' a self ) -> impl Iterator < Item = Word > + ' _ where & ' a Backend : IntoIterator < Item = & ' a Word > , { let bulk_iter = self . bulk . into_iter ( ) . cloned ( ) ; let state_iter = bit_array_to_chunks_truncated ( self . state ) . rev ( ) ; bulk_iter . chain ( state_iter ) }
Iterates over the compressed data currently on the ans.
Iterates over the compressed data currently on the ans .
&'a self
&'a self
example
```
use constriction::stream::{model::DefaultLeakyQuantizer, stack::DefaultAnsCoder, Decode}.

Create a stack and encode some stuff.
let mut ans = DefaultAnsCoder::new();
let symbols = vec![8, -12, 0, 7];
let quantizer = DefaultLeakyQuantizer::new(-100..=100);
let model
quantizer.quantize(probability::distribution::Gaussian::new(0.0, 10.0));
ans.encode_iid_symbols_reverse(&symbols, &model).unwrap().

Iterate over compressed data, collect it into to a Vec``, and compare to direct method.
let compressed_iter = ans.iter_compressed();
let compressed_collected = compressed_iter.collect::>();
assert!(!compressed_collected.is_empty());
assert_eq!(compressed_collected, *ans.get_compressed().unwrap());
```

[`get_compressed`]: #method.get_compressed
[`into_compressed`]: #method.into_compressed
` ` ` use constriction :: stream :: { model :: DefaultLeakyQuantizer stack :: DefaultAnsCoder Decode } . Create a stack and encode some stuff . let mut ans = DefaultAnsCoder :: new () ; let symbols = vec! [ 8 - 12 0 7 ] ; let quantizer = DefaultLeakyQuantizer :: new ( - 100 .. = 100 ) ; let model quantizer . quantize ( probability :: distribution :: Gaussian :: new ( 0 . 0 10 . 0 )) ; ans . encode_iid_symbols_reverse ( &symbols &model ) . unwrap () . Iterate over compressed data collect it into to a Vec ` ` and compare to direct method . let compressed_iter = ans . iter_compressed () ; let compressed_collected = compressed_iter . collect :: > () ; assert! ( !compressed_collected . is_empty () ) ; assert_eq! ( compressed_collected * ans . get_compressed () . unwrap () ) ; ` ` ` [ ` get_compressed ` ] : #method . get_compressed [ ` into_compressed ` ] : #method . into_compressed