pub trait IntoReadWords<Word, S: Semantics> {
    type IntoReadWords: ReadWords<Word, S>;

    // Required method
    fn into_read_words(self) -> Self::IntoReadWords;
}
Expand description

A trait for types that can be turned into a source of compressed data (for decoders).

This trait is roughly analogous to the standard library trait IntoIterator, except that it is generic over Word rather than having Word as an associated type. This makes it possible to convert a single type into data sources of varying word sizes (for example, one could imagine implementing both IntoReadWords<u32> and IntoReadWords<u16> for Vec<u8> using the byteorder crate).

See also

Required Associated Types§

source

type IntoReadWords: ReadWords<Word, S>

The type of the data source that will result from the conversion.

Required Methods§

source

fn into_read_words(self) -> Self::IntoReadWords

Performs the conversion.

Implementors§

source§

impl<Word: Clone, Buf: AsRef<[Word]>> IntoReadWords<Word, Queue> for Buf

§

type IntoReadWords = Cursor<Word, Buf>

source§

impl<Word: Clone, Buf: SafeBuf<Word>> IntoReadWords<Word, Stack> for Buf

§

type IntoReadWords = Cursor<Word, Buf>