pub trait AsReadWords<'a, Word, S: Semantics>: 'a {
    type AsReadWords: ReadWords<Word, S>;

    // Required method
    fn as_read_words(&'a self) -> Self::AsReadWords;
}
Expand description

A trait for types that can be temporarily used by decoders as a source of compressed data.

This trait is meant for situations where you want to use some data as a source of Words without consuming it. This allows you to decode the same compressed data several times but it means that you typically won’t be allowed to return the resulting data source or any entropy coder that wraps it from the current function because it doesn’t take ownership of the data. If you want to take ownership of the data, use IntoReadWords instead.

Note that, if you want to decode the same compressed data several times then you’ll probably want to decode different parts of that data each time. In this case, it’s likely you’ll rather want to use AsSeekReadWords.

See also

Required Associated Types§

source

type AsReadWords: ReadWords<Word, S>

The type of the data source as which the original type can be used.

Required Methods§

source

fn as_read_words(&'a self) -> Self::AsReadWords

Performs the (temporary) conversion.

Implementors§

source§

impl<'a, Word: Clone + 'a, Buf: AsRef<[Word]> + 'a> AsReadWords<'a, Word, Queue> for Buf

§

type AsReadWords = Cursor<Word, &'a [Word]>

source§

impl<'a, Word: Clone + 'a, Buf: SafeBuf<Word> + 'a> AsReadWords<'a, Word, Stack> for Buf

§

type AsReadWords = Cursor<Word, &'a [Word]>