pub struct Decoder<R> { /* private fields */ }Expand description
A decoder for decoding lilliput-encoded values.
Implementations§
Source§impl<'de, R> Decoder<R>where
R: Read<'de>,
impl<'de, R> Decoder<R>where
R: Read<'de>,
Sourcepub fn decode_bool(&mut self) -> Result<bool>where
R: Read<'de>,
pub fn decode_bool(&mut self) -> Result<bool>where
R: Read<'de>,
Decodes a boolean value.
Sourcepub fn decode_bool_value(&mut self) -> Result<BoolValue>
pub fn decode_bool_value(&mut self) -> Result<BoolValue>
Decodes a boolean value, as a BoolValue.
Sourcepub fn decode_bool_header(&mut self) -> Result<BoolHeader>
pub fn decode_bool_header(&mut self) -> Result<BoolHeader>
Decodes a boolean value’s header.
Sourcepub fn skip_bool_value_of(&mut self, header: BoolHeader) -> Result<()>where
R: Read<'de>,
pub fn skip_bool_value_of(&mut self, header: BoolHeader) -> Result<()>where
R: Read<'de>,
Skips the boolean value for a given header.
Sourcepub fn decode_bool_value_of(&mut self, header: BoolHeader) -> Result<BoolValue>
pub fn decode_bool_value_of(&mut self, header: BoolHeader) -> Result<BoolValue>
Decodes boolean value for a given header, as a BoolValue.
Source§impl<'de, R> Decoder<R>where
R: Read<'de>,
impl<'de, R> Decoder<R>where
R: Read<'de>,
Sourcepub fn decode_bytes<'s>(
&'s mut self,
scratch: &'s mut Vec<u8>,
) -> Result<Reference<'de, 's, [u8]>>
pub fn decode_bytes<'s>( &'s mut self, scratch: &'s mut Vec<u8>, ) -> Result<Reference<'de, 's, [u8]>>
Decodes a byte array value, as a slice reference.
Sourcepub fn decode_bytes_buf(&mut self) -> Result<Vec<u8>>
pub fn decode_bytes_buf(&mut self) -> Result<Vec<u8>>
Decodes a byte array value, as an owned buffer.
Sourcepub fn decode_bytes_value(&mut self) -> Result<BytesValue>
pub fn decode_bytes_value(&mut self) -> Result<BytesValue>
Decodes a byte array value, as a BytesValue.
Sourcepub fn decode_bytes_header(&mut self) -> Result<BytesHeader>
pub fn decode_bytes_header(&mut self) -> Result<BytesHeader>
Decodes a byte array value’s header.
Sourcepub fn skip_bytes_value_of(&mut self, header: BytesHeader) -> Result<()>where
R: Read<'de>,
pub fn skip_bytes_value_of(&mut self, header: BytesHeader) -> Result<()>where
R: Read<'de>,
Skips the byte array value for a given header.
Sourcepub fn decode_bytes_value_of(
&mut self,
header: BytesHeader,
) -> Result<BytesValue>
pub fn decode_bytes_value_of( &mut self, header: BytesHeader, ) -> Result<BytesValue>
Decodes byte array value for a given header, as a BytesValue.
Source§impl<'de, R> Decoder<R>where
R: Read<'de>,
impl<'de, R> Decoder<R>where
R: Read<'de>,
Sourcepub fn decode_f32(&mut self) -> Result<f32>
pub fn decode_f32(&mut self) -> Result<f32>
Decodes a 32-bit floating-point value.
Sourcepub fn decode_f64(&mut self) -> Result<f64>
pub fn decode_f64(&mut self) -> Result<f64>
Decodes a 64-bit floating-point value.
Sourcepub fn decode_float_value(&mut self) -> Result<FloatValue>
pub fn decode_float_value(&mut self) -> Result<FloatValue>
Decodes a floating-point value, as a FloatValue.
Sourcepub fn decode_float_header(&mut self) -> Result<FloatHeader>
pub fn decode_float_header(&mut self) -> Result<FloatHeader>
Decodes a floating-point value’s header.
Sourcepub fn skip_float_value_of(&mut self, header: FloatHeader) -> Result<()>
pub fn skip_float_value_of(&mut self, header: FloatHeader) -> Result<()>
Skips the floating-point value for a given header.
Sourcepub fn decode_float_value_of(
&mut self,
header: FloatHeader,
) -> Result<FloatValue>
pub fn decode_float_value_of( &mut self, header: FloatHeader, ) -> Result<FloatValue>
Decodes floating-point value for a given header, as a FloatValue.
Source§impl<'de, R> Decoder<R>where
R: Read<'de>,
impl<'de, R> Decoder<R>where
R: Read<'de>,
Sourcepub fn decode_i16(&mut self) -> Result<i16>
pub fn decode_i16(&mut self) -> Result<i16>
Decodes a 16-bit signed integer value.
Sourcepub fn decode_i32(&mut self) -> Result<i32>
pub fn decode_i32(&mut self) -> Result<i32>
Decodes a 32-bit signed integer value.
Sourcepub fn decode_i64(&mut self) -> Result<i64>
pub fn decode_i64(&mut self) -> Result<i64>
Decodes a 64-bit signed integer value.
Sourcepub fn decode_u16(&mut self) -> Result<u16>
pub fn decode_u16(&mut self) -> Result<u16>
Decodes a 16-bit unsigned integer value.
Sourcepub fn decode_u32(&mut self) -> Result<u32>
pub fn decode_u32(&mut self) -> Result<u32>
Decodes a 32-bit unsigned integer value.
Sourcepub fn decode_u64(&mut self) -> Result<u64>
pub fn decode_u64(&mut self) -> Result<u64>
Decodes a 64-bit unsigned integer value.
Sourcepub fn decode_signed_int<T>(&mut self) -> Result<T>
pub fn decode_signed_int<T>(&mut self) -> Result<T>
Decodes a signed integer value.
Sourcepub fn decode_unsigned_int<T>(&mut self) -> Result<T>
pub fn decode_unsigned_int<T>(&mut self) -> Result<T>
Decodes a unsigned integer value.
Sourcepub fn decode_signed_int_value(&mut self) -> Result<SignedIntValue>
pub fn decode_signed_int_value(&mut self) -> Result<SignedIntValue>
Decodes a signed integer value, as a SignedIntValue.
Sourcepub fn decode_unsigned_int_value(&mut self) -> Result<UnsignedIntValue>
pub fn decode_unsigned_int_value(&mut self) -> Result<UnsignedIntValue>
Decodes a unsigned integer value, as a UnsignedIntValue.
Sourcepub fn decode_int_value(&mut self) -> Result<IntValue>
pub fn decode_int_value(&mut self) -> Result<IntValue>
Decodes a integer value, as an IntValue.
Sourcepub fn decode_int_header(&mut self) -> Result<IntHeader>
pub fn decode_int_header(&mut self) -> Result<IntHeader>
Decodes a integer value’s header.
Sourcepub fn skip_int_value_of(&mut self, header: IntHeader) -> Result<()>
pub fn skip_int_value_of(&mut self, header: IntHeader) -> Result<()>
Skips the integer value for a given header.
Sourcepub fn decode_int_value_of(&mut self, header: IntHeader) -> Result<IntValue>
pub fn decode_int_value_of(&mut self, header: IntHeader) -> Result<IntValue>
Decodes integer value for a given header, as an IntValue.
Source§impl<'de, R> Decoder<R>where
R: Read<'de>,
impl<'de, R> Decoder<R>where
R: Read<'de>,
Sourcepub fn decode_map(&mut self) -> Result<Map>
pub fn decode_map(&mut self) -> Result<Map>
Decodes a map value.
Sourcepub fn decode_map_value(&mut self) -> Result<MapValue>
pub fn decode_map_value(&mut self) -> Result<MapValue>
Decodes a map value, as a MapValue.
Sourcepub fn decode_map_header(&mut self) -> Result<MapHeader>
pub fn decode_map_header(&mut self) -> Result<MapHeader>
Decodes a map value’s header.
Sourcepub fn skip_map_value_of(&mut self, header: MapHeader) -> Result<()>
pub fn skip_map_value_of(&mut self, header: MapHeader) -> Result<()>
Skips the map value for a given header.
Sourcepub fn decode_map_value_of(&mut self, header: MapHeader) -> Result<MapValue>
pub fn decode_map_value_of(&mut self, header: MapHeader) -> Result<MapValue>
Decodes map value for a given header, as a MapValue.
Source§impl<'r, R> Decoder<R>where
R: Read<'r>,
impl<'r, R> Decoder<R>where
R: Read<'r>,
Sourcepub fn decode_null(&mut self) -> Result<()>
pub fn decode_null(&mut self) -> Result<()>
Decodes a null value.
Sourcepub fn decode_null_value(&mut self) -> Result<NullValue>
pub fn decode_null_value(&mut self) -> Result<NullValue>
Decodes a null value, as a NullValue.
Sourcepub fn decode_null_header(&mut self) -> Result<NullHeader>
pub fn decode_null_header(&mut self) -> Result<NullHeader>
Decodes a null value’s header.
Sourcepub fn skip_null_value_of(&mut self, header: NullHeader) -> Result<()>
pub fn skip_null_value_of(&mut self, header: NullHeader) -> Result<()>
Skips the null value for a given header.
Sourcepub fn decode_null_value_of(&mut self, header: NullHeader) -> Result<NullValue>
pub fn decode_null_value_of(&mut self, header: NullHeader) -> Result<NullValue>
Decodes null value for a given header, as a NullValue.
Source§impl<'de, R> Decoder<R>where
R: Read<'de>,
impl<'de, R> Decoder<R>where
R: Read<'de>,
Sourcepub fn decode_seq(&mut self) -> Result<Seq>
pub fn decode_seq(&mut self) -> Result<Seq>
Decodes a sequence value.
Sourcepub fn decode_seq_value(&mut self) -> Result<SeqValue>
pub fn decode_seq_value(&mut self) -> Result<SeqValue>
Decodes a sequence value, as a SeqValue.
Sourcepub fn decode_seq_header(&mut self) -> Result<SeqHeader>
pub fn decode_seq_header(&mut self) -> Result<SeqHeader>
Decodes a sequence value’s header.
Sourcepub fn skip_seq_value_of(&mut self, header: SeqHeader) -> Result<()>
pub fn skip_seq_value_of(&mut self, header: SeqHeader) -> Result<()>
Skips the sequence value for a given header.
Sourcepub fn decode_seq_value_of(&mut self, header: SeqHeader) -> Result<SeqValue>
pub fn decode_seq_value_of(&mut self, header: SeqHeader) -> Result<SeqValue>
Decodes sequence value for a given header, as a SeqValue.
Source§impl<'de, R> Decoder<R>where
R: Read<'de>,
impl<'de, R> Decoder<R>where
R: Read<'de>,
Sourcepub fn decode_str<'s>(
&'s mut self,
scratch: &'s mut Vec<u8>,
) -> Result<Reference<'de, 's, str>>
pub fn decode_str<'s>( &'s mut self, scratch: &'s mut Vec<u8>, ) -> Result<Reference<'de, 's, str>>
Decodes a string value, as a reference.
Sourcepub fn decode_str_bytes<'s>(
&'s mut self,
scratch: &'s mut Vec<u8>,
) -> Result<Reference<'de, 's, [u8]>>
pub fn decode_str_bytes<'s>( &'s mut self, scratch: &'s mut Vec<u8>, ) -> Result<Reference<'de, 's, [u8]>>
Decodes a string value’s raw-bytes, as a reference.
Sourcepub fn decode_string(&mut self) -> Result<String>
pub fn decode_string(&mut self) -> Result<String>
Decodes a string value, as an owned string.
Sourcepub fn decode_string_bytes_buf(&mut self) -> Result<Vec<u8>>
pub fn decode_string_bytes_buf(&mut self) -> Result<Vec<u8>>
Decodes a string value’s raw-bytes, as an owned buffer.
Sourcepub fn decode_string_value(&mut self) -> Result<StringValue>
pub fn decode_string_value(&mut self) -> Result<StringValue>
Decodes a string value, as a StringValue.
Sourcepub fn decode_string_header(&mut self) -> Result<StringHeader>
pub fn decode_string_header(&mut self) -> Result<StringHeader>
Decodes a string value’s header.
Sourcepub fn skip_string_value_of(&mut self, header: StringHeader) -> Result<()>
pub fn skip_string_value_of(&mut self, header: StringHeader) -> Result<()>
Skips the map value for a given header.
Sourcepub fn decode_string_value_of(
&mut self,
header: StringHeader,
) -> Result<StringValue>
pub fn decode_string_value_of( &mut self, header: StringHeader, ) -> Result<StringValue>
Decodes map value for a given header, as a MapValue.
Source§impl<'r, R> Decoder<R>where
R: Read<'r>,
impl<'r, R> Decoder<R>where
R: Read<'r>,
Sourcepub fn decode_unit(&mut self) -> Result<()>
pub fn decode_unit(&mut self) -> Result<()>
Decodes a unit value.
Sourcepub fn decode_unit_value(&mut self) -> Result<UnitValue>
pub fn decode_unit_value(&mut self) -> Result<UnitValue>
Decodes a unit value, as a UnitValue.
Sourcepub fn decode_unit_header(&mut self) -> Result<UnitHeader>
pub fn decode_unit_header(&mut self) -> Result<UnitHeader>
Decodes a unit value’s header.
Sourcepub fn skip_unit_value_of(&mut self, header: UnitHeader) -> Result<()>
pub fn skip_unit_value_of(&mut self, header: UnitHeader) -> Result<()>
Skips the unit value for a given header.
Sourcepub fn decode_unit_value_of(&mut self, header: UnitHeader) -> Result<UnitValue>
pub fn decode_unit_value_of(&mut self, header: UnitHeader) -> Result<UnitValue>
Decodes unit value for a given header, as a UnitValue.
Source§impl<R> Decoder<R>
impl<R> Decoder<R>
Sourcepub fn from_reader(reader: R) -> Self
pub fn from_reader(reader: R) -> Self
Creates a decoder from a reader.
Sourcepub fn into_reader(self) -> R
pub fn into_reader(self) -> R
Returns the decoder’s internal reader, consuming self.
Source§impl<'de, R> Decoder<R>where
R: Read<'de>,
impl<'de, R> Decoder<R>where
R: Read<'de>,
Sourcepub fn decode_value(&mut self) -> Result<Value>
pub fn decode_value(&mut self) -> Result<Value>
Decodes a Value.
Sourcepub fn peek_marker(&mut self) -> Result<Marker>
pub fn peek_marker(&mut self) -> Result<Marker>
Decodes a value’s type Marker.
Sourcepub fn decode_header(&mut self) -> Result<Header>
pub fn decode_header(&mut self) -> Result<Header>
Decodes a value’s Header.
Sourcepub fn skip_value(&mut self) -> Result<()>
pub fn skip_value(&mut self) -> Result<()>
Skips the next to-be-decoded value.
Sourcepub fn skip_value_of(&mut self, header: Header) -> Result<()>
pub fn skip_value_of(&mut self, header: Header) -> Result<()>
Skips the value for a given header.
Sourcepub fn decode_value_of(&mut self, header: Header) -> Result<Value>
pub fn decode_value_of(&mut self, header: Header) -> Result<Value>
Decodes value for a given header.