Trait constriction::backends::IntoReadWords
source · 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
- module level documentation for more information on the concept of sources and sinks of compressed data;
AsReadWords
for a simliar conversion that does not take ownership of the data;IntoSeekReadWords
for a conversion with stronger guarantees.
Required Associated Types§
sourcetype IntoReadWords: ReadWords<Word, S>
type IntoReadWords: ReadWords<Word, S>
The type of the data source that will result from the conversion.
Required Methods§
sourcefn into_read_words(self) -> Self::IntoReadWords
fn into_read_words(self) -> Self::IntoReadWords
Performs the conversion.