pub struct StreamingDecoder<'a, W: Write> { /* private fields */ }Expand description
Streaming decoder for processing large amounts of encoded data efficiently.
Processes data in chunks to avoid loading entire files into memory. Suitable for decoding large files or network streams. Supports optional decompression and hashing during decoding.
Implementations§
Source§impl<'a, W: Write> StreamingDecoder<'a, W>
impl<'a, W: Write> StreamingDecoder<'a, W>
Sourcepub fn new(dictionary: &'a Dictionary, writer: W) -> Self
pub fn new(dictionary: &'a Dictionary, writer: W) -> Self
Creates a new streaming decoder.
§Arguments
dictionary- The dictionary used for encodingwriter- The destination for decoded output
Sourcepub fn with_decompression(self, algo: CompressionAlgorithm) -> Self
pub fn with_decompression(self, algo: CompressionAlgorithm) -> Self
Sets decompression algorithm.
Sourcepub fn with_hashing(self, algo: HashAlgorithm) -> Self
pub fn with_hashing(self, algo: HashAlgorithm) -> Self
Sets hash algorithm for computing hash during decoding.
Sourcepub fn with_xxhash_config(self, config: XxHashConfig) -> Self
pub fn with_xxhash_config(self, config: XxHashConfig) -> Self
Sets xxHash configuration (seed and secret).
Sourcepub fn decode<R: Read>(
&mut self,
reader: &mut R,
) -> Result<Option<Vec<u8>>, DecodeError>
pub fn decode<R: Read>( &mut self, reader: &mut R, ) -> Result<Option<Vec<u8>>, DecodeError>
Decodes data from a reader in chunks.
Note: Radix mode requires reading the entire input at once due to the nature of true base conversion. For truly streaming behavior, use Chunked or ByteRange modes.
Returns the computed hash if hash_algo was set, otherwise None.
Auto Trait Implementations§
impl<'a, W> Freeze for StreamingDecoder<'a, W>where
W: Freeze,
impl<'a, W> RefUnwindSafe for StreamingDecoder<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for StreamingDecoder<'a, W>where
W: Send,
impl<'a, W> Sync for StreamingDecoder<'a, W>where
W: Sync,
impl<'a, W> Unpin for StreamingDecoder<'a, W>where
W: Unpin,
impl<'a, W> UnwindSafe for StreamingDecoder<'a, W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more