pub trait AsSeekReadWords<'a, Word, S: Semantics>: 'a {
    type AsSeekReadWords: Seek + ReadWords<Word, S>;

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

A trait for types that can be temporarily used by random-access 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.

This trait is similar to AsReadWords but it adds the additional guarantee that the resulting data source implements Seek, i.e., that it can be used by decoders that support random access. This is likely what you want if you’re going to construct several decoders for the same compressed data because why would you want decode the whole data several times?

See also

Required Associated Types§

source

type AsSeekReadWords: Seek + ReadWords<Word, S>

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

Required Methods§

source

fn as_seek_read_words(&'a self) -> Self::AsSeekReadWords

Performs the (temporary) conversion.

Implementors§

source§

impl<'a, Word: 'a, Buf, S: Semantics> AsSeekReadWords<'a, Word, S> for Buf
where Buf: AsReadWords<'a, Word, S, AsReadWords = Cursor<Word, &'a [Word]>>, Cursor<Word, &'a [Word]>: ReadWords<Word, S>,

§

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