Skip to main content

PlainBytes

Struct PlainBytes 

Source
pub struct PlainBytes;
Expand description

Encoder that decodes bytes data directly into Vec<u8>, rather than requiring it to be wrapped in Blob. PlainBytes implements encoding for blob values directly into Vec<u8>, and provides the base implementation for that functionality. Vec<u8> cannot generically dispatch to General’s encoding, since General already generically implements encoding for other kinds of Vec, but this encoder can be used instead if it’s desirable to have a value whose type is exactly Vec<u8>.

Trait Implementations§

Source§

impl<'__a, T> BorrowDecoder<'__a, PlainBytes, T> for ()

Decodes plain values encoded as whole fields.

Source§

fn borrow_decode( wire_type: WireType, value: &mut T, buf: Capped<'_, &'__a [u8]>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Source§

impl<'__a, 'a> BorrowDecoder<'__a, PlainBytes, Vec<&'a [u8]>> for ()
where (): BorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<&'a [u8]>>,

Source§

fn borrow_decode( wire_type: WireType, value: &mut Vec<&'a [u8]>, buf: Capped<'_, &'__a [u8]>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Source§

impl<'__a, 'a, const N: usize> BorrowDecoder<'__a, PlainBytes, Vec<&'a [u8; N]>> for ()
where (): BorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<&'a [u8; N]>>,

Source§

fn borrow_decode( wire_type: WireType, value: &mut Vec<&'a [u8; N]>, buf: Capped<'_, &'__a [u8]>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Source§

impl<'__a, 'a> BorrowDecoder<'__a, PlainBytes, Vec<Cow<'a, [u8]>>> for ()
where (): BorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>>,

Source§

fn borrow_decode( wire_type: WireType, value: &mut Vec<Cow<'a, [u8]>>, buf: Capped<'_, &'__a [u8]>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Source§

impl<'__a> BorrowDecoder<'__a, PlainBytes, Vec<Vec<u8>>> for ()

Source§

fn borrow_decode( wire_type: WireType, value: &mut Vec<Vec<u8>>, buf: Capped<'_, &'__a [u8]>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Source§

impl<T> Decoder<PlainBytes, T> for ()

Decodes plain values encoded as whole fields.

Source§

fn decode<__B: Buf + ?Sized>( wire_type: WireType, value: &mut T, buf: Capped<'_, __B>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field’s value with the given wire type; the field’s key should have already been consumed from the buffer.
Source§

impl<'a> Decoder<PlainBytes, Vec<&'a [u8]>> for ()
where (): Decoder<Unpacked<PlainBytes>, Vec<&'a [u8]>>,

Source§

fn decode<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<&'a [u8]>, buf: Capped<'_, B>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field’s value with the given wire type; the field’s key should have already been consumed from the buffer.
Source§

impl<'a, const N: usize> Decoder<PlainBytes, Vec<&'a [u8; N]>> for ()
where (): Decoder<Unpacked<PlainBytes>, Vec<&'a [u8; N]>>,

Source§

fn decode<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<&'a [u8; N]>, buf: Capped<'_, B>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field’s value with the given wire type; the field’s key should have already been consumed from the buffer.
Source§

impl<'a> Decoder<PlainBytes, Vec<Cow<'a, [u8]>>> for ()
where (): Decoder<Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>>,

Source§

fn decode<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<Cow<'a, [u8]>>, buf: Capped<'_, B>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field’s value with the given wire type; the field’s key should have already been consumed from the buffer.
Source§

impl Decoder<PlainBytes, Vec<Vec<u8>>> for ()

Source§

fn decode<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<Vec<u8>>, buf: Capped<'_, B>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field’s value with the given wire type; the field’s key should have already been consumed from the buffer.
Source§

impl<'__a, T> DistinguishedBorrowDecoder<'__a, PlainBytes, T> for ()

Canonical encoding for plain values forbids encoding empty values. This includes directly-nested message types, which are not emitted when all their fields are default. If an empty value is decoded it is considered fully non-canonical.

Source§

fn borrow_decode_distinguished( wire_type: WireType, value: &mut T, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field for the value, returning a value indicating how canonical the encoding was.
Source§

impl<'__a, 'a> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<&'a [u8]>> for ()

Source§

fn borrow_decode_distinguished( wire_type: WireType, value: &mut Vec<&'a [u8]>, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field for the value, returning a value indicating how canonical the encoding was.
Source§

impl<'__a, 'a, const N: usize> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<&'a [u8; N]>> for ()

Source§

fn borrow_decode_distinguished( wire_type: WireType, value: &mut Vec<&'a [u8; N]>, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field for the value, returning a value indicating how canonical the encoding was.
Source§

impl<'__a, 'a> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<Cow<'a, [u8]>>> for ()

Source§

fn borrow_decode_distinguished( wire_type: WireType, value: &mut Vec<Cow<'a, [u8]>>, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field for the value, returning a value indicating how canonical the encoding was.
Source§

impl<'__a> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<Vec<u8>>> for ()

Source§

fn borrow_decode_distinguished( wire_type: WireType, value: &mut Vec<Vec<u8>>, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field for the value, returning a value indicating how canonical the encoding was.
Source§

impl<T> DistinguishedDecoder<PlainBytes, T> for ()

Canonical encoding for plain values forbids encoding empty values. This includes directly-nested message types, which are not emitted when all their fields are default. If an empty value is decoded it is considered fully non-canonical.

Source§

fn decode_distinguished<__B: Buf + ?Sized>( wire_type: WireType, value: &mut T, buf: Capped<'_, __B>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field for the value, returning a value indicating how canonical the encoding was.
Source§

impl<'a> DistinguishedDecoder<PlainBytes, Vec<&'a [u8]>> for ()

Source§

fn decode_distinguished<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<&'a [u8]>, buf: Capped<'_, B>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field for the value, returning a value indicating how canonical the encoding was.
Source§

impl<'a, const N: usize> DistinguishedDecoder<PlainBytes, Vec<&'a [u8; N]>> for ()

Source§

fn decode_distinguished<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<&'a [u8; N]>, buf: Capped<'_, B>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field for the value, returning a value indicating how canonical the encoding was.
Source§

impl<'a> DistinguishedDecoder<PlainBytes, Vec<Cow<'a, [u8]>>> for ()

Source§

fn decode_distinguished<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<Cow<'a, [u8]>>, buf: Capped<'_, B>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field for the value, returning a value indicating how canonical the encoding was.
Source§

impl DistinguishedDecoder<PlainBytes, Vec<Vec<u8>>> for ()

Source§

fn decode_distinguished<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<Vec<u8>>, buf: Capped<'_, B>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field for the value, returning a value indicating how canonical the encoding was.
Source§

impl<'__a, const N: usize> DistinguishedValueBorrowDecoder<'__a, PlainBytes, [u8; N]> for ()

Source§

const CHECKS_EMPTY: bool

Indicates whether the ALLOW_EMPTY argument in borrow_decode_value_distinguished has any effect. Some decoder implementations can more cheaply determine whether they were empty during decoding, and will return NotCanonical if ALLOW_EMPTY was false; for these implementations, CHECKS_EMPTY should be set to true. When CHECKS_EMPTY is false, the caller must invoke EmptyState::is_empty after the call if empty states are non-canonical.
Source§

fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut [u8; N], buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer, also performing any additional validation required to guarantee that the value would be re-encoded into the exact same bytes.
Source§

impl<'__a> DistinguishedValueBorrowDecoder<'__a, PlainBytes, Vec<u8>> for ()

Source§

const CHECKS_EMPTY: bool

Indicates whether the ALLOW_EMPTY argument in borrow_decode_value_distinguished has any effect. Some decoder implementations can more cheaply determine whether they were empty during decoding, and will return NotCanonical if ALLOW_EMPTY was false; for these implementations, CHECKS_EMPTY should be set to true. When CHECKS_EMPTY is false, the caller must invoke EmptyState::is_empty after the call if empty states are non-canonical.
Source§

fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Vec<u8>, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer, also performing any additional validation required to guarantee that the value would be re-encoded into the exact same bytes.
Source§

impl<'a> DistinguishedValueBorrowDecoder<'a, PlainBytes, &'a [u8]> for ()

Source§

const CHECKS_EMPTY: bool = false

Indicates whether the ALLOW_EMPTY argument in borrow_decode_value_distinguished has any effect. Some decoder implementations can more cheaply determine whether they were empty during decoding, and will return NotCanonical if ALLOW_EMPTY was false; for these implementations, CHECKS_EMPTY should be set to true. When CHECKS_EMPTY is false, the caller must invoke EmptyState::is_empty after the call if empty states are non-canonical.
Source§

fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut &'a [u8], buf: Capped<'_, &'a [u8]>, _ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer, also performing any additional validation required to guarantee that the value would be re-encoded into the exact same bytes.
Source§

impl<'a, const N: usize> DistinguishedValueBorrowDecoder<'a, PlainBytes, &'a [u8; N]> for ()

Source§

const CHECKS_EMPTY: bool = false

Indicates whether the ALLOW_EMPTY argument in borrow_decode_value_distinguished has any effect. Some decoder implementations can more cheaply determine whether they were empty during decoding, and will return NotCanonical if ALLOW_EMPTY was false; for these implementations, CHECKS_EMPTY should be set to true. When CHECKS_EMPTY is false, the caller must invoke EmptyState::is_empty after the call if empty states are non-canonical.
Source§

fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut &'a [u8; N], buf: Capped<'_, &'a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer, also performing any additional validation required to guarantee that the value would be re-encoded into the exact same bytes.
Source§

impl<'a> DistinguishedValueBorrowDecoder<'a, PlainBytes, Cow<'a, [u8]>> for ()

Source§

const CHECKS_EMPTY: bool

Indicates whether the ALLOW_EMPTY argument in borrow_decode_value_distinguished has any effect. Some decoder implementations can more cheaply determine whether they were empty during decoding, and will return NotCanonical if ALLOW_EMPTY was false; for these implementations, CHECKS_EMPTY should be set to true. When CHECKS_EMPTY is false, the caller must invoke EmptyState::is_empty after the call if empty states are non-canonical.
Source§

fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Cow<'a, [u8]>, buf: Capped<'_, &'a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer, also performing any additional validation required to guarantee that the value would be re-encoded into the exact same bytes.
Source§

impl<'a, const N: usize> DistinguishedValueBorrowDecoder<'a, PlainBytes, Cow<'a, [u8; N]>> for ()

Source§

const CHECKS_EMPTY: bool

Indicates whether the ALLOW_EMPTY argument in borrow_decode_value_distinguished has any effect. Some decoder implementations can more cheaply determine whether they were empty during decoding, and will return NotCanonical if ALLOW_EMPTY was false; for these implementations, CHECKS_EMPTY should be set to true. When CHECKS_EMPTY is false, the caller must invoke EmptyState::is_empty after the call if empty states are non-canonical.
Source§

fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Cow<'a, [u8; N]>, buf: Capped<'_, &'a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer, also performing any additional validation required to guarantee that the value would be re-encoded into the exact same bytes.
Source§

impl<const N: usize> DistinguishedValueDecoder<PlainBytes, [u8; N]> for ()

Source§

const CHECKS_EMPTY: bool = false

Indicates whether the ALLOW_EMPTY argument in decode_value_distinguished has any effect. Some decoder implementations can more cheaply determine whether they were empty during decoding, and will return NotCanonical if ALLOW_EMPTY was false; for these implementations, CHECKS_EMPTY should be set to true. When CHECKS_EMPTY is false, the caller must invoke EmptyState::is_empty after the call if empty states are non-canonical.
Source§

fn decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut [u8; N], buf: Capped<'_, impl Buf + ?Sized>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer, also performing any additional validation required to guarantee that the value would be re-encoded into the exact same bytes.
Source§

impl DistinguishedValueDecoder<PlainBytes, Cow<'_, [u8]>> for ()

Source§

const CHECKS_EMPTY: bool

Indicates whether the ALLOW_EMPTY argument in decode_value_distinguished has any effect. Some decoder implementations can more cheaply determine whether they were empty during decoding, and will return NotCanonical if ALLOW_EMPTY was false; for these implementations, CHECKS_EMPTY should be set to true. When CHECKS_EMPTY is false, the caller must invoke EmptyState::is_empty after the call if empty states are non-canonical.
Source§

fn decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Cow<'_, [u8]>, buf: Capped<'_, impl Buf + ?Sized>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer, also performing any additional validation required to guarantee that the value would be re-encoded into the exact same bytes.
Source§

impl<const N: usize> DistinguishedValueDecoder<PlainBytes, Cow<'_, [u8; N]>> for ()

Source§

const CHECKS_EMPTY: bool

Indicates whether the ALLOW_EMPTY argument in decode_value_distinguished has any effect. Some decoder implementations can more cheaply determine whether they were empty during decoding, and will return NotCanonical if ALLOW_EMPTY was false; for these implementations, CHECKS_EMPTY should be set to true. When CHECKS_EMPTY is false, the caller must invoke EmptyState::is_empty after the call if empty states are non-canonical.
Source§

fn decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Cow<'_, [u8; N]>, buf: Capped<'_, impl Buf + ?Sized>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer, also performing any additional validation required to guarantee that the value would be re-encoded into the exact same bytes.
Source§

impl DistinguishedValueDecoder<PlainBytes, Vec<u8>> for ()

Source§

const CHECKS_EMPTY: bool = false

Indicates whether the ALLOW_EMPTY argument in decode_value_distinguished has any effect. Some decoder implementations can more cheaply determine whether they were empty during decoding, and will return NotCanonical if ALLOW_EMPTY was false; for these implementations, CHECKS_EMPTY should be set to true. When CHECKS_EMPTY is false, the caller must invoke EmptyState::is_empty after the call if empty states are non-canonical.
Source§

fn decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Vec<u8>, buf: Capped<'_, impl Buf + ?Sized>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer, also performing any additional validation required to guarantee that the value would be re-encoded into the exact same bytes.
Source§

impl<__T> EmptyState<PlainBytes, __T> for ()
where (): EmptyState<(), __T>,

Source§

fn empty() -> __T

Produces the empty state for this type.
Source§

fn is_empty(__val: &__T) -> bool

Returns true iff this instance is in the empty state.
Source§

fn clear(__val: &mut __T)

Source§

impl<T> Encoder<PlainBytes, T> for ()

Encodes plain values only when they are non-empty.

Source§

fn encode<B: BufMut + ?Sized>( tag: u32, value: &T, buf: &mut B, tw: &mut TagWriter, )

Encodes the a field with the given tag and value.
Source§

fn prepend_encode<B: ReverseBuf + ?Sized>( tag: u32, value: &T, buf: &mut B, tw: &mut TagRevWriter, )

Prepends the encoding of the field with the given tag and value.
Source§

fn encoded_len(tag: u32, value: &T, tm: &mut impl TagMeasurer) -> usize

Returns the encoded length of the field, including the key.
Source§

impl<'a> Encoder<PlainBytes, Vec<&'a [u8]>> for ()
where (): Encoder<Unpacked<PlainBytes>, Vec<&'a [u8]>>,

Source§

fn encode<B: BufMut + ?Sized>( tag: u32, value: &Vec<&'a [u8]>, buf: &mut B, tw: &mut TagWriter, )

Encodes the a field with the given tag and value.
Source§

fn prepend_encode<B: ReverseBuf + ?Sized>( tag: u32, value: &Vec<&'a [u8]>, buf: &mut B, tw: &mut TagRevWriter, )

Prepends the encoding of the field with the given tag and value.
Source§

fn encoded_len( tag: u32, value: &Vec<&'a [u8]>, tm: &mut impl TagMeasurer, ) -> usize

Returns the encoded length of the field, including the key.
Source§

impl<'a, const N: usize> Encoder<PlainBytes, Vec<&'a [u8; N]>> for ()
where (): Encoder<Unpacked<PlainBytes>, Vec<&'a [u8; N]>>,

Source§

fn encode<B: BufMut + ?Sized>( tag: u32, value: &Vec<&'a [u8; N]>, buf: &mut B, tw: &mut TagWriter, )

Encodes the a field with the given tag and value.
Source§

fn prepend_encode<B: ReverseBuf + ?Sized>( tag: u32, value: &Vec<&'a [u8; N]>, buf: &mut B, tw: &mut TagRevWriter, )

Prepends the encoding of the field with the given tag and value.
Source§

fn encoded_len( tag: u32, value: &Vec<&'a [u8; N]>, tm: &mut impl TagMeasurer, ) -> usize

Returns the encoded length of the field, including the key.
Source§

impl<'a> Encoder<PlainBytes, Vec<Cow<'a, [u8]>>> for ()
where (): Encoder<Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>>,

Source§

fn encode<B: BufMut + ?Sized>( tag: u32, value: &Vec<Cow<'a, [u8]>>, buf: &mut B, tw: &mut TagWriter, )

Encodes the a field with the given tag and value.
Source§

fn prepend_encode<B: ReverseBuf + ?Sized>( tag: u32, value: &Vec<Cow<'a, [u8]>>, buf: &mut B, tw: &mut TagRevWriter, )

Prepends the encoding of the field with the given tag and value.
Source§

fn encoded_len( tag: u32, value: &Vec<Cow<'a, [u8]>>, tm: &mut impl TagMeasurer, ) -> usize

Returns the encoded length of the field, including the key.
Source§

impl Encoder<PlainBytes, Vec<Vec<u8>>> for ()

Source§

fn encode<B: BufMut + ?Sized>( tag: u32, value: &Vec<Vec<u8>>, buf: &mut B, tw: &mut TagWriter, )

Encodes the a field with the given tag and value.
Source§

fn prepend_encode<B: ReverseBuf + ?Sized>( tag: u32, value: &Vec<Vec<u8>>, buf: &mut B, tw: &mut TagRevWriter, )

Prepends the encoding of the field with the given tag and value.
Source§

fn encoded_len( tag: u32, value: &Vec<Vec<u8>>, tm: &mut impl TagMeasurer, ) -> usize

Returns the encoded length of the field, including the key.
Source§

impl<__T> ForOverwrite<PlainBytes, __T> for ()
where (): ForOverwrite<(), __T>,

Source§

fn for_overwrite() -> __T

Produces a new Self value to be overwritten.
Source§

impl<'__a, const N: usize> ValueBorrowDecoder<'__a, PlainBytes, [u8; N]> for ()

Source§

fn borrow_decode_value( value: &mut [u8; N], buf: Capped<'_, &'__a [u8]>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer.
Source§

impl<'__a> ValueBorrowDecoder<'__a, PlainBytes, Vec<u8>> for ()

Source§

fn borrow_decode_value( value: &mut Vec<u8>, buf: Capped<'_, &'__a [u8]>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer.
Source§

impl<'a> ValueBorrowDecoder<'a, PlainBytes, &'a [u8]> for ()

Source§

fn borrow_decode_value( value: &mut &'a [u8], buf: Capped<'_, &'a [u8]>, _ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer.
Source§

impl<'a, const N: usize> ValueBorrowDecoder<'a, PlainBytes, &'a [u8; N]> for ()

Source§

fn borrow_decode_value( value: &mut &'a [u8; N], buf: Capped<'_, &'a [u8]>, _ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer.
Source§

impl<'a> ValueBorrowDecoder<'a, PlainBytes, Cow<'a, [u8]>> for ()

Source§

fn borrow_decode_value( value: &mut Cow<'a, [u8]>, buf: Capped<'_, &'a [u8]>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer.
Source§

impl<'a, const N: usize> ValueBorrowDecoder<'a, PlainBytes, Cow<'a, [u8; N]>> for ()

Source§

fn borrow_decode_value( value: &mut Cow<'a, [u8; N]>, buf: Capped<'_, &'a [u8]>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer.
Source§

impl<const N: usize> ValueDecoder<PlainBytes, [u8; N]> for ()

Source§

fn decode_value<B: Buf + ?Sized>( value: &mut [u8; N], buf: Capped<'_, B>, _ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer.
Source§

impl ValueDecoder<PlainBytes, Cow<'_, [u8]>> for ()

Source§

fn decode_value<B: Buf + ?Sized>( value: &mut Cow<'_, [u8]>, buf: Capped<'_, B>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer.
Source§

impl<const N: usize> ValueDecoder<PlainBytes, Cow<'_, [u8; N]>> for ()

Source§

fn decode_value<B: Buf + ?Sized>( value: &mut Cow<'_, [u8; N]>, buf: Capped<'_, B>, ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer.
Source§

impl ValueDecoder<PlainBytes, Vec<u8>> for ()

Source§

fn decode_value<B: Buf + ?Sized>( value: &mut Vec<u8>, buf: Capped<'_, B>, _ctx: DecodeContext, ) -> Result<(), DecodeError>

Decodes a field assuming the encoder’s wire type directly from the buffer.
Source§

impl ValueEncoder<PlainBytes, &[u8]> for ()

Source§

fn encode_value<B: BufMut + ?Sized>(value: &&[u8], buf: &mut B)

Encodes the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn prepend_value<B: ReverseBuf + ?Sized>(value: &&[u8], buf: &mut B)

Prepends the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn value_encoded_len(value: &&[u8]) -> usize

Returns the number of bytes the given value would be encoded as.
Source§

fn many_values_encoded_len<I>(values: I) -> usize
where I: ExactSizeIterator, I::Item: Deref<Target = T>,

Returns the number of total bytes to encode all the values in the given container.
Source§

impl<'a, const N: usize> ValueEncoder<PlainBytes, &'a [u8; N]> for ()

Source§

fn encode_value<B: BufMut + ?Sized>(value: &&'a [u8; N], buf: &mut B)

Encodes the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn prepend_value<B: ReverseBuf + ?Sized>(value: &&'a [u8; N], buf: &mut B)

Prepends the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn value_encoded_len(value: &&'a [u8; N]) -> usize

Returns the number of bytes the given value would be encoded as.
Source§

fn many_values_encoded_len<I>(values: I) -> usize
where I: ExactSizeIterator, I::Item: Deref<Target = &'a [u8; N]>,

Returns the number of total bytes to encode all the values in the given container.
Source§

impl<const N: usize> ValueEncoder<PlainBytes, [u8; N]> for ()

Source§

fn encode_value<B: BufMut + ?Sized>(value: &[u8; N], buf: &mut B)

Encodes the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn prepend_value<B: ReverseBuf + ?Sized>(value: &[u8; N], buf: &mut B)

Prepends the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn value_encoded_len(_value: &[u8; N]) -> usize

Returns the number of bytes the given value would be encoded as.
Source§

fn many_values_encoded_len<I>(values: I) -> usize
where I: ExactSizeIterator, I::Item: Deref<Target = [u8; N]>,

Returns the number of total bytes to encode all the values in the given container.
Source§

impl ValueEncoder<PlainBytes, Cow<'_, [u8]>> for ()

Source§

fn encode_value<B: BufMut + ?Sized>(value: &Cow<'_, [u8]>, buf: &mut B)

Encodes the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn prepend_value<B: ReverseBuf + ?Sized>(value: &Cow<'_, [u8]>, buf: &mut B)

Prepends the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn value_encoded_len(value: &Cow<'_, [u8]>) -> usize

Returns the number of bytes the given value would be encoded as.
Source§

fn many_values_encoded_len<I>(values: I) -> usize
where I: ExactSizeIterator, I::Item: Deref<Target = T>,

Returns the number of total bytes to encode all the values in the given container.
Source§

impl<const N: usize> ValueEncoder<PlainBytes, Cow<'_, [u8; N]>> for ()

Source§

fn encode_value<B: BufMut + ?Sized>(value: &Cow<'_, [u8; N]>, buf: &mut B)

Encodes the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn prepend_value<B: ReverseBuf + ?Sized>(value: &Cow<'_, [u8; N]>, buf: &mut B)

Prepends the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn value_encoded_len(value: &Cow<'_, [u8; N]>) -> usize

Returns the number of bytes the given value would be encoded as.
Source§

fn many_values_encoded_len<I>(values: I) -> usize
where I: ExactSizeIterator, I::Item: Deref<Target = T>,

Returns the number of total bytes to encode all the values in the given container.
Source§

impl ValueEncoder<PlainBytes, Vec<u8>> for ()

Source§

fn encode_value<B: BufMut + ?Sized>(value: &Vec<u8>, buf: &mut B)

Encodes the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn prepend_value<B: ReverseBuf + ?Sized>(value: &Vec<u8>, buf: &mut B)

Prepends the given value unconditionally. This is guaranteed to emit data to the buffer.
Source§

fn value_encoded_len(value: &Vec<u8>) -> usize

Returns the number of bytes the given value would be encoded as.
Source§

fn many_values_encoded_len<I>(values: I) -> usize
where I: ExactSizeIterator, I::Item: Deref<Target = T>,

Returns the number of total bytes to encode all the values in the given container.
Source§

impl Wiretyped<PlainBytes, &[u8]> for ()

Source§

const WIRE_TYPE: WireType = WireType::LengthDelimited

Source§

impl<const N: usize> Wiretyped<PlainBytes, &[u8; N]> for ()

Source§

const WIRE_TYPE: WireType = WireType::LengthDelimited

Source§

impl<const N: usize> Wiretyped<PlainBytes, [u8; N]> for ()

Source§

const WIRE_TYPE: WireType = WireType::LengthDelimited

Source§

impl Wiretyped<PlainBytes, Cow<'_, [u8]>> for ()

Source§

impl<const N: usize> Wiretyped<PlainBytes, Cow<'_, [u8; N]>> for ()

Source§

impl Wiretyped<PlainBytes, Vec<u8>> for ()

Source§

const WIRE_TYPE: WireType = WireType::LengthDelimited

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.