pub struct PackedReader<'de, 'src, N: NestedValue, Dec: DomainDecode<N::Embedded>, S: BinarySource<'de>> {
pub source: &'src mut S,
pub decode_embedded: Dec,
/* private fields */
}Expand description
The binary encoding Preserves reader.
Fields§
§source: &'src mut SUnderlying source of bytes.
decode_embedded: DecDecoder for producing Rust values embedded in the binary data.
Implementations§
Source§impl<'de, 'src, N: NestedValue, Dec: DomainDecode<N::Embedded>, S: BinarySource<'de>> PackedReader<'de, 'src, N, Dec, S>
impl<'de, 'src, N: NestedValue, Dec: DomainDecode<N::Embedded>, S: BinarySource<'de>> PackedReader<'de, 'src, N, Dec, S>
Sourcepub fn new(source: &'src mut S, decode_embedded: Dec) -> Self
pub fn new(source: &'src mut S, decode_embedded: Dec) -> Self
Construct a new reader from a byte source and embedded-value decoder.
Trait Implementations§
Source§impl<'de, 'src, N: NestedValue, Dec: DomainDecode<N::Embedded>, S: BinarySource<'de>> BinarySource<'de> for PackedReader<'de, 'src, N, Dec, S>
impl<'de, 'src, N: NestedValue, Dec: DomainDecode<N::Embedded>, S: BinarySource<'de>> BinarySource<'de> for PackedReader<'de, 'src, N, Dec, S>
Source§type Mark = <S as BinarySource<'de>>::Mark
type Mark = <S as BinarySource<'de>>::Mark
Allows structured backtracking to an earlier position in an input.
Source§fn mark(&mut self) -> Result<Self::Mark>
fn mark(&mut self) -> Result<Self::Mark>
Retrieve a marker for the current position in the input.
Source§fn restore(&mut self, mark: &Self::Mark) -> Result<()>
fn restore(&mut self, mark: &Self::Mark) -> Result<()>
Seek the input to a previously-saved position.
Source§fn readbytes(&mut self, count: usize) -> Result<Cow<'de, [u8]>>
fn readbytes(&mut self, count: usize) -> Result<Cow<'de, [u8]>>
Returns and consumes the next
count bytes, which must all be available. Always yields
exactly count bytes or an error.Source§fn readbytes_into(&mut self, bs: &mut [u8]) -> Result<()>
fn readbytes_into(&mut self, bs: &mut [u8]) -> Result<()>
As BinarySource::readbytes, but uses
bs as destination for the read bytes as well
as taking the size of bs as the count of bytes to read.Source§fn packed<N: NestedValue, Dec: DomainDecode<N::Embedded>>(
&mut self,
decode_embedded: Dec,
) -> PackedReader<'de, '_, N, Dec, Self>
fn packed<N: NestedValue, Dec: DomainDecode<N::Embedded>>( &mut self, decode_embedded: Dec, ) -> PackedReader<'de, '_, N, Dec, Self>
Constructs a PackedReader that will read from
self.Source§fn packed_iovalues(
&mut self,
) -> PackedReader<'de, '_, IOValue, IOValueDomainCodec, Self>
fn packed_iovalues( &mut self, ) -> PackedReader<'de, '_, IOValue, IOValueDomainCodec, Self>
Source§fn text<N: NestedValue, Dec: DomainParse<N::Embedded>>(
&mut self,
decode_embedded: Dec,
) -> TextReader<'de, '_, N, Dec, Self>
fn text<N: NestedValue, Dec: DomainParse<N::Embedded>>( &mut self, decode_embedded: Dec, ) -> TextReader<'de, '_, N, Dec, Self>
Constructs a TextReader that will read from
self.Source§fn text_iovalues(
&mut self,
) -> TextReader<'de, '_, IOValue, ViaCodec<IOValueDomainCodec>, Self>
fn text_iovalues( &mut self, ) -> TextReader<'de, '_, IOValue, ViaCodec<IOValueDomainCodec>, Self>
Source§impl<'de, 'src, N: NestedValue, Dec: DomainDecode<N::Embedded>, S: BinarySource<'de>> Reader<'de, N> for PackedReader<'de, 'src, N, Dec, S>
impl<'de, 'src, N: NestedValue, Dec: DomainDecode<N::Embedded>, S: BinarySource<'de>> Reader<'de, N> for PackedReader<'de, 'src, N, Dec, S>
Source§type Mark = <S as BinarySource<'de>>::Mark
type Mark = <S as BinarySource<'de>>::Mark
Allows structured backtracking to an earlier stage in a parse. Useful for layering
parser combinators atop a Reader.
Source§fn next(&mut self, read_annotations: bool) -> Result<Option<N>>
fn next(&mut self, read_annotations: bool) -> Result<Option<N>>
Retrieve the next parseable value or an indication of end-of-input. Read more
Source§fn mark(&mut self) -> Result<Self::Mark>
fn mark(&mut self) -> Result<Self::Mark>
Retrieve a marker for the current position in the input.
Source§fn restore(&mut self, mark: &Self::Mark) -> Result<()>
fn restore(&mut self, mark: &Self::Mark) -> Result<()>
Seek the input to a previously-saved position.
Source§fn next_annotations_and_token(&mut self) -> Result<(Vec<N>, Token<N>)>
fn next_annotations_and_token(&mut self) -> Result<(Vec<N>, Token<N>)>
Get the next SAX-style event, plus
a vector containing any annotations that preceded it.
Source§fn next_boolean(&mut self) -> ReaderResult<bool>
fn next_boolean(&mut self) -> ReaderResult<bool>
Yields the next value, if it is a
Boolean, or an error otherwise.Source§fn next_signedinteger(&mut self) -> ReaderResult<SignedInteger>
fn next_signedinteger(&mut self) -> ReaderResult<SignedInteger>
Yields the next value, if it is a
SignedInteger, or an error otherwise.Source§fn next_i8(&mut self) -> ReaderResult<i8>
fn next_i8(&mut self) -> ReaderResult<i8>
Yields the next value, if it is a
SignedInteger that fits in i8, or an error
otherwise.Source§fn next_i16(&mut self) -> ReaderResult<i16>
fn next_i16(&mut self) -> ReaderResult<i16>
Yields the next value, if it is a
SignedInteger that fits in i16, or an error
otherwise.Source§fn next_i32(&mut self) -> ReaderResult<i32>
fn next_i32(&mut self) -> ReaderResult<i32>
Yields the next value, if it is a
SignedInteger that fits in i32, or an error
otherwise.Source§fn next_i64(&mut self) -> ReaderResult<i64>
fn next_i64(&mut self) -> ReaderResult<i64>
Yields the next value, if it is a
SignedInteger that fits in i64, or an error
otherwise.Source§fn next_i128(&mut self) -> ReaderResult<i128>
fn next_i128(&mut self) -> ReaderResult<i128>
Yields the next value, if it is a
SignedInteger that fits in i128, or an error
otherwise.Source§fn next_u8(&mut self) -> ReaderResult<u8>
fn next_u8(&mut self) -> ReaderResult<u8>
Yields the next value, if it is a
SignedInteger that fits in u8, or an error
otherwise.Source§fn next_u16(&mut self) -> ReaderResult<u16>
fn next_u16(&mut self) -> ReaderResult<u16>
Yields the next value, if it is a
SignedInteger that fits in u16, or an error
otherwise.Source§fn next_u32(&mut self) -> ReaderResult<u32>
fn next_u32(&mut self) -> ReaderResult<u32>
Yields the next value, if it is a
SignedInteger that fits in u32, or an error
otherwise.Source§fn next_u64(&mut self) -> ReaderResult<u64>
fn next_u64(&mut self) -> ReaderResult<u64>
Yields the next value, if it is a
SignedInteger that fits in u64, or an error
otherwise.Source§fn next_u128(&mut self) -> ReaderResult<u128>
fn next_u128(&mut self) -> ReaderResult<u128>
Yields the next value, if it is a
SignedInteger that fits in u128, or an error
otherwise.Source§fn next_f64(&mut self) -> ReaderResult<f64>
fn next_f64(&mut self) -> ReaderResult<f64>
Yields the next value as an f64, if it is a
Double, or an error otherwise.Source§fn next_str(&mut self) -> ReaderResult<Cow<'de, str>>
fn next_str(&mut self) -> ReaderResult<Cow<'de, str>>
Yields the next value, if it is a
String, or an error otherwise.Source§fn next_bytestring(&mut self) -> ReaderResult<Cow<'de, [u8]>>
fn next_bytestring(&mut self) -> ReaderResult<Cow<'de, [u8]>>
Yields the next value, if it is a
ByteString, or an error otherwise.Source§fn next_symbol(&mut self) -> ReaderResult<Cow<'de, str>>
fn next_symbol(&mut self) -> ReaderResult<Cow<'de, str>>
Yields the next value, if it is a
Symbol, or an error otherwise.Source§fn skip_value(&mut self) -> Result<()>
fn skip_value(&mut self) -> Result<()>
Skips the next available complete value. Yields an error if no such value exists.
Source§fn demand_next(&mut self, read_annotations: bool) -> Result<N>
fn demand_next(&mut self, read_annotations: bool) -> Result<N>
Retrieve the next parseable value, treating end-of-input as an error. Read more
Source§fn next_double(&mut self) -> ReaderResult<Double>
fn next_double(&mut self) -> ReaderResult<Double>
Yields the next value, if it is a
Double, or an error otherwise.Source§fn next_char(&mut self) -> ReaderResult<char>
fn next_char(&mut self) -> ReaderResult<char>
Yields the next value as a char, if it is parseable by
Value::to_char, or an error otherwise.
Source§fn configured(self, read_annotations: bool) -> ConfiguredReader<'de, N, Self> ⓘwhere
Self: Sized,
fn configured(self, read_annotations: bool) -> ConfiguredReader<'de, N, Self> ⓘwhere
Self: Sized,
Constructs a ConfiguredReader set with the given value for
read_annotations.Auto Trait Implementations§
impl<'de, 'src, N, Dec, S> !UnwindSafe for PackedReader<'de, 'src, N, Dec, S>
impl<'de, 'src, N, Dec, S> Freeze for PackedReader<'de, 'src, N, Dec, S>where
Dec: Freeze,
impl<'de, 'src, N, Dec, S> RefUnwindSafe for PackedReader<'de, 'src, N, Dec, S>
impl<'de, 'src, N, Dec, S> Send for PackedReader<'de, 'src, N, Dec, S>
impl<'de, 'src, N, Dec, S> Sync for PackedReader<'de, 'src, N, Dec, S>
impl<'de, 'src, N, Dec, S> Unpin for PackedReader<'de, 'src, N, Dec, S>where
Dec: Unpin,
impl<'de, 'src, N, Dec, S> UnsafeUnpin for PackedReader<'de, 'src, N, Dec, S>where
Dec: UnsafeUnpin,
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