pub struct Base64DecodeLimits {
pub encoded_input_bytes: Option<u64>,
pub decoded_output_bytes: Option<u64>,
}Expand description
Independent budgets for strict padded-standard Base64 decoding. Omitted fields select defaults of 2,097,152 encoded bytes and 1,572,864 decoded bytes. Explicit zero permits only empty input/output. Limits must fit the platform’s addressable buffer size. Encoded bytes exclude any caller-removed data-URL prefix; alphabet, padding and unused pad bits must be canonical RFC 4648. The native API may raise either budget; transport envelopes retain their existing independent hard limits.
Fields§
§encoded_input_bytes: Option<u64>Field 1: encoded_input_bytes
decoded_output_bytes: Option<u64>Field 2: decoded_output_bytes
Implementations§
Source§impl CodecBase64DecodeLimits
impl CodecBase64DecodeLimits
Sourcepub fn with_encoded_input_bytes(self, value: u64) -> CodecBase64DecodeLimits
pub fn with_encoded_input_bytes(self, value: u64) -> CodecBase64DecodeLimits
Sets Self::encoded_input_bytes to Some(value), consuming and returning self.
Sourcepub fn with_decoded_output_bytes(self, value: u64) -> CodecBase64DecodeLimits
pub fn with_decoded_output_bytes(self, value: u64) -> CodecBase64DecodeLimits
Sets Self::decoded_output_bytes to Some(value), consuming and returning self.
Trait Implementations§
Source§impl Clone for CodecBase64DecodeLimits
impl Clone for CodecBase64DecodeLimits
Source§fn clone(&self) -> CodecBase64DecodeLimits
fn clone(&self) -> CodecBase64DecodeLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CodecBase64DecodeLimits
impl Debug for CodecBase64DecodeLimits
Source§impl Default for CodecBase64DecodeLimits
impl Default for CodecBase64DecodeLimits
Source§fn default() -> CodecBase64DecodeLimits
fn default() -> CodecBase64DecodeLimits
Source§impl DefaultInstance for CodecBase64DecodeLimits
impl DefaultInstance for CodecBase64DecodeLimits
Source§fn default_instance() -> &'static CodecBase64DecodeLimits
fn default_instance() -> &'static CodecBase64DecodeLimits
Source§impl<'de> Deserialize<'de> for CodecBase64DecodeLimits
impl<'de> Deserialize<'de> for CodecBase64DecodeLimits
Source§fn deserialize<__D>(
d: __D,
) -> Result<CodecBase64DecodeLimits, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
d: __D,
) -> Result<CodecBase64DecodeLimits, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Drop for CodecBase64DecodeLimits
impl Drop for CodecBase64DecodeLimits
Source§impl Message for CodecBase64DecodeLimits
impl Message for CodecBase64DecodeLimits
Source§fn compute_size(&self, _cache: &mut SizeCache) -> u32
fn compute_size(&self, _cache: &mut SizeCache) -> u32
Returns the total encoded size in bytes.
Accumulates in u64 (which cannot overflow for in-memory
data) and saturates to u32 at return, so a message whose
encoded size exceeds the 2 GiB protobuf limit yields a value
above ::buffa::MAX_MESSAGE_BYTES that the encode entry
points reject, never a silently wrapped size.
Source§fn write_to(&self, _cache: &mut SizeCache, buf: &mut impl EncodeSink)
fn write_to(&self, _cache: &mut SizeCache, buf: &mut impl EncodeSink)
cache (populated by a prior
compute_size call on the same cache). Read moreSource§fn merge_field(
&mut self,
tag: Tag,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
) -> Result<(), DecodeError>
fn merge_field( &mut self, tag: Tag, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>
buf. Read moreSource§fn encode(&self, buf: &mut impl EncodeSink)
fn encode(&self, buf: &mut impl EncodeSink)
Source§fn try_encode(&self, buf: &mut impl EncodeSink) -> Result<(), EncodeError>
fn try_encode(&self, buf: &mut impl EncodeSink) -> Result<(), EncodeError>
MAX_MESSAGE_BYTES). Read moreSource§fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl EncodeSink)
fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl EncodeSink)
Source§fn try_encode_with_cache(
&self,
cache: &mut SizeCache,
buf: &mut impl EncodeSink,
) -> Result<(), EncodeError>
fn try_encode_with_cache( &self, cache: &mut SizeCache, buf: &mut impl EncodeSink, ) -> Result<(), EncodeError>
SizeCache,
returning an error instead of panicking if the encoded size exceeds
the 2 GiB protobuf limit (MAX_MESSAGE_BYTES). Clears the cache
first. Read moreSource§fn try_encode_bounded(
&self,
max_bytes: u32,
buf: &mut impl EncodeSink,
) -> Result<u32, EncodeError>
fn try_encode_bounded( &self, max_bytes: u32, buf: &mut impl EncodeSink, ) -> Result<u32, EncodeError>
buf only if its encoded size fits within
max_bytes, using a single size pass that is then reused for the write. Read moreSource§fn try_encode_bounded_with_cache(
&self,
max_bytes: u32,
cache: &mut SizeCache,
buf: &mut impl EncodeSink,
) -> Result<u32, EncodeError>
fn try_encode_bounded_with_cache( &self, max_bytes: u32, cache: &mut SizeCache, buf: &mut impl EncodeSink, ) -> Result<u32, EncodeError>
Source§fn encoded_len(&self) -> u32
fn encoded_len(&self) -> u32
Source§fn try_encoded_len(&self) -> Result<u32, EncodeError>
fn try_encoded_len(&self) -> Result<u32, EncodeError>
MAX_MESSAGE_BYTES). Read moreSource§fn encode_length_delimited(&self, buf: &mut impl EncodeSink)
fn encode_length_delimited(&self, buf: &mut impl EncodeSink)
Source§fn try_encode_length_delimited(
&self,
buf: &mut impl EncodeSink,
) -> Result<(), EncodeError>
fn try_encode_length_delimited( &self, buf: &mut impl EncodeSink, ) -> Result<(), EncodeError>
MAX_MESSAGE_BYTES). Read moreSource§fn try_encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
fn try_encode_to_vec(&self) -> Result<Vec<u8>, EncodeError>
Vec<u8>, returning an error instead of panicking
if the encoded size exceeds the 2 GiB protobuf limit
(MAX_MESSAGE_BYTES). Read moreSource§fn encode_to_bytes(&self) -> Bytes
fn encode_to_bytes(&self) -> Bytes
bytes::Bytes. Read moreSource§fn try_encode_to_bytes(&self) -> Result<Bytes, EncodeError>
fn try_encode_to_bytes(&self) -> Result<Bytes, EncodeError>
bytes::Bytes, returning an error instead of
panicking if the encoded size exceeds the 2 GiB protobuf limit
(MAX_MESSAGE_BYTES). Read moreSource§fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn merge_to_limit(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
limit: usize,
) -> Result<(), DecodeError>
fn merge_to_limit( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, limit: usize, ) -> Result<(), DecodeError>
Source§fn merge_group(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
field_number: u32,
) -> Result<(), DecodeError>
fn merge_group( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, field_number: u32, ) -> Result<(), DecodeError>
buf, reading fields until an
EndGroup tag with the given field_number is encountered. Read moreSource§fn merge(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
) -> Result<(), DecodeError>
fn merge( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>
Source§fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
Source§fn merge_length_delimited(
&mut self,
buf: &mut impl Buf,
ctx: DecodeContext<'_>,
) -> Result<(), DecodeError>
fn merge_length_delimited( &mut self, buf: &mut impl Buf, ctx: DecodeContext<'_>, ) -> Result<(), DecodeError>
Source§impl MessageName for CodecBase64DecodeLimits
impl MessageName for CodecBase64DecodeLimits
Source§const PACKAGE: &'static str = "reallyme.codec.v1"
const PACKAGE: &'static str = "reallyme.codec.v1"
Source§const NAME: &'static str = "CodecBase64DecodeLimits"
const NAME: &'static str = "CodecBase64DecodeLimits"
. between nesting levels. Read moreSource§impl PartialEq for CodecBase64DecodeLimits
impl PartialEq for CodecBase64DecodeLimits
Source§impl ProtoElemJson for CodecBase64DecodeLimits
impl ProtoElemJson for CodecBase64DecodeLimits
Source§fn serialize_proto_json<__S>(
v: &CodecBase64DecodeLimits,
s: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize_proto_json<__S>(
v: &CodecBase64DecodeLimits,
s: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§fn deserialize_proto_json<'de, __D>(
d: __D,
) -> Result<CodecBase64DecodeLimits, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize_proto_json<'de, __D>(
d: __D,
) -> Result<CodecBase64DecodeLimits, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§fn deserialize_proto_json_null<E>() -> Result<Self, E>where
E: Error,
fn deserialize_proto_json_null<E>() -> Result<Self, E>where
E: Error,
null when it is a valid representation of this
protobuf type inside a container. Most protobuf element types reject
null; google.protobuf.Value overrides this for its null variant.