pub struct Decoder<R> { /* private fields */ }Expand description
A decoder for a multiplexed YTsaurus Skiff input stream.
Implementations§
Source§impl<R: Read> Decoder<R>
impl<R: Read> Decoder<R>
Sourcepub fn with_max_blob_bytes(self, bytes: usize) -> Self
pub fn with_max_blob_bytes(self, bytes: usize) -> Self
Changes the maximum string32 or yson32 payload this decoder accepts.
Sourcepub fn with_max_row_bytes(self, bytes: usize) -> Self
pub fn with_max_row_bytes(self, bytes: usize) -> Self
Changes the maximum decoded footprint this decoder accepts per row.
See DEFAULT_MAX_ROW_BYTES for why a blob limit alone is not enough.
Sourcepub fn next_row(&mut self) -> Result<Option<(usize, Value)>, CodecError>
pub fn next_row(&mut self) -> Result<Option<(usize, Value)>, CodecError>
Decodes the next table-indexed row, or None at a clean end of stream.
An end of stream after any part of a row is CodecError::Truncated,
never a successful short read.
Sourcepub fn skip_row(&mut self) -> Result<Option<usize>, CodecError>
pub fn skip_row(&mut self) -> Result<Option<usize>, CodecError>
Advances past the next row without building it, returning its table
index, or None at a clean end of stream.
Framing, schema and limit checks are the ones Self::next_row
applies, so a stream this accepts is exactly a stream that decodes.
What it does not do is allocate: no Vec per blob, no Box per
variant, no Value tree to throw away. That is the difference between
asking whether a stream is a whole number of rows and decoding it to
find out — the first question is the one a caller validating a table
write is asking.
Sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Returns the wrapped input reader.