pub fn from_binary(
        mut data: CompressedBackend,
    ) -> Result<Self, CoderError<CompressedBackend, CompressedBackend::ReadError>>
    where
        CompressedBackend: ReadWords<Word, Stack>,
        RemaindersBackend: Default,
    {
        let heads = match ChainCoderHeads::new(&mut data, true) {
            Ok(heads) => heads,
            Err(CoderError::Frontend(())) => return Err(CoderError::Frontend(data)),
            Err(CoderError::Backend(err)) => return Err(CoderError::Backend(err)),
        };
        let remainders = RemaindersBackend::default();

        Ok(Self {
            compressed: data,
            remainders,
            heads,
        })
    }
/// Creates a new `ChainCoder` for decoding from the provided `data`.
///
/// The reader `data` must have enough words to initialize the chain heads but can
/// otherwise be arbitrary. In particualar, `data` doesn't necessary have to come from
/// an [`AnsCoder`]. If you know that `data` comes from an `AnsCoder` then it's slightly
/// better to call [`from_compressed`] instead.
///
/// Retuns an error if `data` does not have enough words to initialize the chain heads
/// or if reading from `data` lead to an error.
///
/// [`AnsCoder`]: super::stack::AnsCoder
/// [`from_compressed`]: Self::from_compressed
Creates a new `ChainCoder` for decoding from the provided `data`.
The reader `data` must have enough words to initialize the chain heads but can
otherwise be arbitrary. In particualar, `data` doesn't necessary have to come from
an [`AnsCoder`].

Retuns an error if `data` does not have enough words to initialize the chain heads
or if reading from `data` lead to an error.


Creates a new ` ChainCoder ` for decoding from the provided ` data ` . The reader ` data ` must have enough words to initialize the chain heads but can otherwise be arbitrary . In particualar ` data ` doesn ' t necessary have to come from an [ ` AnsCoder ` ] . Retuns an error if ` data ` does not have enough words to initialize the chain heads or if reading from ` data ` lead to an error .
pub fn from_binary(
        mut data: CompressedBackend,
    ) -> Result<Self, CoderError<CompressedBackend, CompressedBackend::ReadError>>
    where
        CompressedBackend: ReadWords<Word, Stack>,
        RemaindersBackend: Default,
    {
        let heads = match ChainCoderHeads::new(&mut data, true) {
            Ok(heads) => heads,
            Err(CoderError::Frontend(())) => return Err(CoderError::Frontend(data)),
            Err(CoderError::Backend(err)) => return Err(CoderError::Backend(err)),
        };
        let remainders = RemaindersBackend::default();
        Ok(Self {
            compressed: data,
            remainders,
            heads,
        })
    }
pub fn from_binary ( mut data : CompressedBackend , ) -> Result < Self , CoderError < CompressedBackend , CompressedBackend :: ReadError > > where CompressedBackend : ReadWords < Word , Stack > , RemaindersBackend : Default , { let heads = match ChainCoderHeads :: new ( & mut data , true ) { Ok ( heads ) => heads , Err ( CoderError :: Frontend ( ( ) ) ) => return Err ( CoderError :: Frontend ( data ) ) , Err ( CoderError :: Backend ( err ) ) => return Err ( CoderError :: Backend ( err ) ) , } ; let remainders = RemaindersBackend :: default ( ) ; Ok ( Self { compressed : data , remainders , heads , } ) }
Creates a new `ChainCoder` for decoding from the provided `data`.
Creates a new ` ChainCoder ` for decoding from the provided ` data ` .
data
CompressedBackend
data
CompressedBackend