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.
impl<'__a, T> BorrowDecoder<'__a, PlainBytes, T> for ()
Decodes plain values encoded as whole fields.
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 ()
impl<'__a, 'a> BorrowDecoder<'__a, PlainBytes, Vec<&'a [u8]>> for ()
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 ()
impl<'__a, 'a, const N: usize> BorrowDecoder<'__a, PlainBytes, Vec<&'a [u8; N]>> for ()
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 ()
impl<'__a, 'a> BorrowDecoder<'__a, PlainBytes, Vec<Cow<'a, [u8]>>> for ()
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 ()
impl<'__a> BorrowDecoder<'__a, PlainBytes, Vec<Vec<u8>>> for ()
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.
impl<T> Decoder<PlainBytes, T> for ()
Decodes plain values encoded as whole fields.
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.
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>
fn borrow_decode_distinguished( wire_type: WireType, value: &mut T, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'__a, 'a> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<&'a [u8]>> for ()where
(): DistinguishedBorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<&'a [u8]>> + Encoder<Unpacked<PlainBytes>, Vec<&'a [u8]>>,
impl<'__a, 'a> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<&'a [u8]>> for ()where
(): DistinguishedBorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<&'a [u8]>> + Encoder<Unpacked<PlainBytes>, Vec<&'a [u8]>>,
Source§fn borrow_decode_distinguished(
wire_type: WireType,
value: &mut Vec<&'a [u8]>,
buf: Capped<'_, &'__a [u8]>,
ctx: RestrictedDecodeContext,
) -> Result<Canonicity, DecodeError>
fn borrow_decode_distinguished( wire_type: WireType, value: &mut Vec<&'a [u8]>, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'__a, 'a, const N: usize> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<&'a [u8; N]>> for ()where
(): DistinguishedBorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<&'a [u8; N]>> + Encoder<Unpacked<PlainBytes>, Vec<&'a [u8; N]>>,
impl<'__a, 'a, const N: usize> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<&'a [u8; N]>> for ()where
(): DistinguishedBorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<&'a [u8; N]>> + Encoder<Unpacked<PlainBytes>, Vec<&'a [u8; N]>>,
Source§fn borrow_decode_distinguished(
wire_type: WireType,
value: &mut Vec<&'a [u8; N]>,
buf: Capped<'_, &'__a [u8]>,
ctx: RestrictedDecodeContext,
) -> Result<Canonicity, DecodeError>
fn borrow_decode_distinguished( wire_type: WireType, value: &mut Vec<&'a [u8; N]>, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'__a, 'a> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<Cow<'a, [u8]>>> for ()where
(): DistinguishedBorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>> + Encoder<Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>>,
impl<'__a, 'a> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<Cow<'a, [u8]>>> for ()where
(): DistinguishedBorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>> + Encoder<Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>>,
Source§fn borrow_decode_distinguished(
wire_type: WireType,
value: &mut Vec<Cow<'a, [u8]>>,
buf: Capped<'_, &'__a [u8]>,
ctx: RestrictedDecodeContext,
) -> Result<Canonicity, DecodeError>
fn borrow_decode_distinguished( wire_type: WireType, value: &mut Vec<Cow<'a, [u8]>>, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'__a> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<Vec<u8>>> for ()where
(): DistinguishedBorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<Vec<u8>>> + Encoder<Unpacked<PlainBytes>, Vec<Vec<u8>>>,
impl<'__a> DistinguishedBorrowDecoder<'__a, PlainBytes, Vec<Vec<u8>>> for ()where
(): DistinguishedBorrowDecoder<'__a, Unpacked<PlainBytes>, Vec<Vec<u8>>> + Encoder<Unpacked<PlainBytes>, Vec<Vec<u8>>>,
Source§fn borrow_decode_distinguished(
wire_type: WireType,
value: &mut Vec<Vec<u8>>,
buf: Capped<'_, &'__a [u8]>,
ctx: RestrictedDecodeContext,
) -> Result<Canonicity, DecodeError>
fn borrow_decode_distinguished( wire_type: WireType, value: &mut Vec<Vec<u8>>, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
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.
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>
fn decode_distinguished<__B: Buf + ?Sized>( wire_type: WireType, value: &mut T, buf: Capped<'_, __B>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'a> DistinguishedDecoder<PlainBytes, Vec<&'a [u8]>> for ()where
(): DistinguishedDecoder<Unpacked<PlainBytes>, Vec<&'a [u8]>> + Encoder<Unpacked<PlainBytes>, Vec<&'a [u8]>>,
impl<'a> DistinguishedDecoder<PlainBytes, Vec<&'a [u8]>> for ()where
(): DistinguishedDecoder<Unpacked<PlainBytes>, Vec<&'a [u8]>> + Encoder<Unpacked<PlainBytes>, Vec<&'a [u8]>>,
Source§fn decode_distinguished<B: Buf + ?Sized>(
wire_type: WireType,
value: &mut Vec<&'a [u8]>,
buf: Capped<'_, B>,
ctx: RestrictedDecodeContext,
) -> Result<Canonicity, DecodeError>
fn decode_distinguished<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<&'a [u8]>, buf: Capped<'_, B>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'a, const N: usize> DistinguishedDecoder<PlainBytes, Vec<&'a [u8; N]>> for ()where
(): DistinguishedDecoder<Unpacked<PlainBytes>, Vec<&'a [u8; N]>> + Encoder<Unpacked<PlainBytes>, Vec<&'a [u8; N]>>,
impl<'a, const N: usize> DistinguishedDecoder<PlainBytes, Vec<&'a [u8; N]>> for ()where
(): DistinguishedDecoder<Unpacked<PlainBytes>, Vec<&'a [u8; N]>> + Encoder<Unpacked<PlainBytes>, Vec<&'a [u8; N]>>,
Source§fn decode_distinguished<B: Buf + ?Sized>(
wire_type: WireType,
value: &mut Vec<&'a [u8; N]>,
buf: Capped<'_, B>,
ctx: RestrictedDecodeContext,
) -> Result<Canonicity, DecodeError>
fn decode_distinguished<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<&'a [u8; N]>, buf: Capped<'_, B>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'a> DistinguishedDecoder<PlainBytes, Vec<Cow<'a, [u8]>>> for ()where
(): DistinguishedDecoder<Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>> + Encoder<Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>>,
impl<'a> DistinguishedDecoder<PlainBytes, Vec<Cow<'a, [u8]>>> for ()where
(): DistinguishedDecoder<Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>> + Encoder<Unpacked<PlainBytes>, Vec<Cow<'a, [u8]>>>,
Source§fn decode_distinguished<B: Buf + ?Sized>(
wire_type: WireType,
value: &mut Vec<Cow<'a, [u8]>>,
buf: Capped<'_, B>,
ctx: RestrictedDecodeContext,
) -> Result<Canonicity, DecodeError>
fn decode_distinguished<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<Cow<'a, [u8]>>, buf: Capped<'_, B>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl DistinguishedDecoder<PlainBytes, Vec<Vec<u8>>> for ()where
(): DistinguishedDecoder<Unpacked<PlainBytes>, Vec<Vec<u8>>> + Encoder<Unpacked<PlainBytes>, Vec<Vec<u8>>>,
impl DistinguishedDecoder<PlainBytes, Vec<Vec<u8>>> for ()where
(): DistinguishedDecoder<Unpacked<PlainBytes>, Vec<Vec<u8>>> + Encoder<Unpacked<PlainBytes>, Vec<Vec<u8>>>,
Source§fn decode_distinguished<B: Buf + ?Sized>(
wire_type: WireType,
value: &mut Vec<Vec<u8>>,
buf: Capped<'_, B>,
ctx: RestrictedDecodeContext,
) -> Result<Canonicity, DecodeError>
fn decode_distinguished<B: Buf + ?Sized>( wire_type: WireType, value: &mut Vec<Vec<u8>>, buf: Capped<'_, B>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'__a, const N: usize> DistinguishedValueBorrowDecoder<'__a, PlainBytes, [u8; N]> for ()
impl<'__a, const N: usize> DistinguishedValueBorrowDecoder<'__a, PlainBytes, [u8; N]> for ()
Source§const CHECKS_EMPTY: bool
const CHECKS_EMPTY: bool
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>
fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut [u8; N], buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'__a> DistinguishedValueBorrowDecoder<'__a, PlainBytes, Vec<u8>> for ()
impl<'__a> DistinguishedValueBorrowDecoder<'__a, PlainBytes, Vec<u8>> for ()
Source§const CHECKS_EMPTY: bool
const CHECKS_EMPTY: bool
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>
fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Vec<u8>, buf: Capped<'_, &'__a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'a> DistinguishedValueBorrowDecoder<'a, PlainBytes, &'a [u8]> for ()
impl<'a> DistinguishedValueBorrowDecoder<'a, PlainBytes, &'a [u8]> for ()
Source§const CHECKS_EMPTY: bool = false
const CHECKS_EMPTY: bool = false
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>
fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut &'a [u8], buf: Capped<'_, &'a [u8]>, _ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'a, const N: usize> DistinguishedValueBorrowDecoder<'a, PlainBytes, &'a [u8; N]> for ()
impl<'a, const N: usize> DistinguishedValueBorrowDecoder<'a, PlainBytes, &'a [u8; N]> for ()
Source§const CHECKS_EMPTY: bool = false
const CHECKS_EMPTY: bool = false
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>
fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut &'a [u8; N], buf: Capped<'_, &'a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'a> DistinguishedValueBorrowDecoder<'a, PlainBytes, Cow<'a, [u8]>> for ()
impl<'a> DistinguishedValueBorrowDecoder<'a, PlainBytes, Cow<'a, [u8]>> for ()
Source§const CHECKS_EMPTY: bool
const CHECKS_EMPTY: bool
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>
fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Cow<'a, [u8]>, buf: Capped<'_, &'a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<'a, const N: usize> DistinguishedValueBorrowDecoder<'a, PlainBytes, Cow<'a, [u8; N]>> for ()
impl<'a, const N: usize> DistinguishedValueBorrowDecoder<'a, PlainBytes, Cow<'a, [u8; N]>> for ()
Source§const CHECKS_EMPTY: bool
const CHECKS_EMPTY: bool
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>
fn borrow_decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Cow<'a, [u8; N]>, buf: Capped<'_, &'a [u8]>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<const N: usize> DistinguishedValueDecoder<PlainBytes, [u8; N]> for ()
impl<const N: usize> DistinguishedValueDecoder<PlainBytes, [u8; N]> for ()
Source§const CHECKS_EMPTY: bool = false
const CHECKS_EMPTY: bool = false
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>
fn decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut [u8; N], buf: Capped<'_, impl Buf + ?Sized>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl DistinguishedValueDecoder<PlainBytes, Cow<'_, [u8]>> for ()
impl DistinguishedValueDecoder<PlainBytes, Cow<'_, [u8]>> for ()
Source§const CHECKS_EMPTY: bool
const CHECKS_EMPTY: bool
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>
fn decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Cow<'_, [u8]>, buf: Capped<'_, impl Buf + ?Sized>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<const N: usize> DistinguishedValueDecoder<PlainBytes, Cow<'_, [u8; N]>> for ()
impl<const N: usize> DistinguishedValueDecoder<PlainBytes, Cow<'_, [u8; N]>> for ()
Source§const CHECKS_EMPTY: bool
const CHECKS_EMPTY: bool
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>
fn decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Cow<'_, [u8; N]>, buf: Capped<'_, impl Buf + ?Sized>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl DistinguishedValueDecoder<PlainBytes, Vec<u8>> for ()
impl DistinguishedValueDecoder<PlainBytes, Vec<u8>> for ()
Source§const CHECKS_EMPTY: bool = false
const CHECKS_EMPTY: bool = false
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>
fn decode_value_distinguished<const ALLOW_EMPTY: bool>( value: &mut Vec<u8>, buf: Capped<'_, impl Buf + ?Sized>, ctx: RestrictedDecodeContext, ) -> Result<Canonicity, DecodeError>
Source§impl<__T> EmptyState<PlainBytes, __T> for ()
impl<__T> EmptyState<PlainBytes, __T> for ()
Source§impl<T> Encoder<PlainBytes, T> for ()
Encodes plain values only when they are non-empty.
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,
)
fn encode<B: BufMut + ?Sized>( tag: u32, value: &T, buf: &mut B, tw: &mut TagWriter, )
Source§fn prepend_encode<B: ReverseBuf + ?Sized>(
tag: u32,
value: &T,
buf: &mut B,
tw: &mut TagRevWriter,
)
fn prepend_encode<B: ReverseBuf + ?Sized>( tag: u32, value: &T, buf: &mut B, tw: &mut TagRevWriter, )
Source§fn encoded_len(tag: u32, value: &T, tm: &mut impl TagMeasurer) -> usize
fn encoded_len(tag: u32, value: &T, tm: &mut impl TagMeasurer) -> usize
Source§impl<'a> Encoder<PlainBytes, Vec<&'a [u8]>> for ()
impl<'a> Encoder<PlainBytes, Vec<&'a [u8]>> for ()
Source§fn encode<B: BufMut + ?Sized>(
tag: u32,
value: &Vec<&'a [u8]>,
buf: &mut B,
tw: &mut TagWriter,
)
fn encode<B: BufMut + ?Sized>( tag: u32, value: &Vec<&'a [u8]>, buf: &mut B, tw: &mut TagWriter, )
Source§fn prepend_encode<B: ReverseBuf + ?Sized>(
tag: u32,
value: &Vec<&'a [u8]>,
buf: &mut B,
tw: &mut TagRevWriter,
)
fn prepend_encode<B: ReverseBuf + ?Sized>( tag: u32, value: &Vec<&'a [u8]>, buf: &mut B, tw: &mut TagRevWriter, )
Source§fn encoded_len(
tag: u32,
value: &Vec<&'a [u8]>,
tm: &mut impl TagMeasurer,
) -> usize
fn encoded_len( tag: u32, value: &Vec<&'a [u8]>, tm: &mut impl TagMeasurer, ) -> usize
Source§impl<'a, const N: usize> Encoder<PlainBytes, Vec<&'a [u8; N]>> for ()
impl<'a, const N: usize> Encoder<PlainBytes, Vec<&'a [u8; N]>> for ()
Source§fn encode<B: BufMut + ?Sized>(
tag: u32,
value: &Vec<&'a [u8; N]>,
buf: &mut B,
tw: &mut TagWriter,
)
fn encode<B: BufMut + ?Sized>( tag: u32, value: &Vec<&'a [u8; N]>, buf: &mut B, tw: &mut TagWriter, )
Source§fn prepend_encode<B: ReverseBuf + ?Sized>(
tag: u32,
value: &Vec<&'a [u8; N]>,
buf: &mut B,
tw: &mut TagRevWriter,
)
fn prepend_encode<B: ReverseBuf + ?Sized>( tag: u32, value: &Vec<&'a [u8; N]>, buf: &mut B, tw: &mut TagRevWriter, )
Source§fn encoded_len(
tag: u32,
value: &Vec<&'a [u8; N]>,
tm: &mut impl TagMeasurer,
) -> usize
fn encoded_len( tag: u32, value: &Vec<&'a [u8; N]>, tm: &mut impl TagMeasurer, ) -> usize
Source§impl<'a> Encoder<PlainBytes, Vec<Cow<'a, [u8]>>> for ()
impl<'a> Encoder<PlainBytes, Vec<Cow<'a, [u8]>>> for ()
Source§fn encode<B: BufMut + ?Sized>(
tag: u32,
value: &Vec<Cow<'a, [u8]>>,
buf: &mut B,
tw: &mut TagWriter,
)
fn encode<B: BufMut + ?Sized>( tag: u32, value: &Vec<Cow<'a, [u8]>>, buf: &mut B, tw: &mut TagWriter, )
Source§fn prepend_encode<B: ReverseBuf + ?Sized>(
tag: u32,
value: &Vec<Cow<'a, [u8]>>,
buf: &mut B,
tw: &mut TagRevWriter,
)
fn prepend_encode<B: ReverseBuf + ?Sized>( tag: u32, value: &Vec<Cow<'a, [u8]>>, buf: &mut B, tw: &mut TagRevWriter, )
Source§fn encoded_len(
tag: u32,
value: &Vec<Cow<'a, [u8]>>,
tm: &mut impl TagMeasurer,
) -> usize
fn encoded_len( tag: u32, value: &Vec<Cow<'a, [u8]>>, tm: &mut impl TagMeasurer, ) -> usize
Source§impl Encoder<PlainBytes, Vec<Vec<u8>>> for ()
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,
)
fn encode<B: BufMut + ?Sized>( tag: u32, value: &Vec<Vec<u8>>, buf: &mut B, tw: &mut TagWriter, )
Source§fn prepend_encode<B: ReverseBuf + ?Sized>(
tag: u32,
value: &Vec<Vec<u8>>,
buf: &mut B,
tw: &mut TagRevWriter,
)
fn prepend_encode<B: ReverseBuf + ?Sized>( tag: u32, value: &Vec<Vec<u8>>, buf: &mut B, tw: &mut TagRevWriter, )
Source§fn encoded_len(
tag: u32,
value: &Vec<Vec<u8>>,
tm: &mut impl TagMeasurer,
) -> usize
fn encoded_len( tag: u32, value: &Vec<Vec<u8>>, tm: &mut impl TagMeasurer, ) -> usize
Source§impl<__T> ForOverwrite<PlainBytes, __T> for ()
impl<__T> ForOverwrite<PlainBytes, __T> for ()
Source§fn for_overwrite() -> __T
fn for_overwrite() -> __T
Self value to be overwritten.