#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum CodecKeyMaterialKind {
CODEC_KEY_MATERIAL_KIND_UNSPECIFIED = 0i32,
CODEC_KEY_MATERIAL_KIND_PUBLIC_KEY = 1i32,
CODEC_KEY_MATERIAL_KIND_PRIVATE_KEY = 2i32,
CODEC_KEY_MATERIAL_KIND_SYMMETRIC_KEY = 3i32,
CODEC_KEY_MATERIAL_KIND_NOT_KEY = 4i32,
}
impl CodecKeyMaterialKind {
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::CODEC_KEY_MATERIAL_KIND_UNSPECIFIED;
#[allow(non_upper_case_globals)]
pub const PublicKey: Self = Self::CODEC_KEY_MATERIAL_KIND_PUBLIC_KEY;
#[allow(non_upper_case_globals)]
pub const PrivateKey: Self = Self::CODEC_KEY_MATERIAL_KIND_PRIVATE_KEY;
#[allow(non_upper_case_globals)]
pub const SymmetricKey: Self = Self::CODEC_KEY_MATERIAL_KIND_SYMMETRIC_KEY;
#[allow(non_upper_case_globals)]
pub const NotKey: Self = Self::CODEC_KEY_MATERIAL_KIND_NOT_KEY;
}
impl ::core::default::Default for CodecKeyMaterialKind {
fn default() -> Self {
Self::CODEC_KEY_MATERIAL_KIND_UNSPECIFIED
}
}
impl ::serde::Serialize for CodecKeyMaterialKind {
fn serialize<S: ::serde::Serializer>(
&self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
s.serialize_str(::buffa::Enumeration::proto_name(self))
}
}
impl<'de> ::serde::Deserialize<'de> for CodecKeyMaterialKind {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = CodecKeyMaterialKind;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(CodecKeyMaterialKind)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<CodecKeyMaterialKind, E> {
<CodecKeyMaterialKind as ::buffa::Enumeration>::from_proto_name(v)
.ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
}
fn visit_i64<E: ::serde::de::Error>(
self,
v: i64,
) -> ::core::result::Result<CodecKeyMaterialKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<CodecKeyMaterialKind as ::buffa::Enumeration>::from_i32(v32)
.ok_or_else(|| {
::serde::de::Error::custom(
::buffa::alloc::format!("unknown enum value {v32}"),
)
})
}
fn visit_u64<E: ::serde::de::Error>(
self,
v: u64,
) -> ::core::result::Result<CodecKeyMaterialKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<CodecKeyMaterialKind as ::buffa::Enumeration>::from_i32(v32)
.ok_or_else(|| {
::serde::de::Error::custom(
::buffa::alloc::format!("unknown enum value {v32}"),
)
})
}
fn visit_unit<E: ::serde::de::Error>(
self,
) -> ::core::result::Result<CodecKeyMaterialKind, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecKeyMaterialKind {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
impl ::buffa::Enumeration for CodecKeyMaterialKind {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => {
::core::option::Option::Some(Self::CODEC_KEY_MATERIAL_KIND_UNSPECIFIED)
}
1i32 => {
::core::option::Option::Some(Self::CODEC_KEY_MATERIAL_KIND_PUBLIC_KEY)
}
2i32 => {
::core::option::Option::Some(Self::CODEC_KEY_MATERIAL_KIND_PRIVATE_KEY)
}
3i32 => {
::core::option::Option::Some(Self::CODEC_KEY_MATERIAL_KIND_SYMMETRIC_KEY)
}
4i32 => ::core::option::Option::Some(Self::CODEC_KEY_MATERIAL_KIND_NOT_KEY),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::CODEC_KEY_MATERIAL_KIND_UNSPECIFIED => {
"CODEC_KEY_MATERIAL_KIND_UNSPECIFIED"
}
Self::CODEC_KEY_MATERIAL_KIND_PUBLIC_KEY => {
"CODEC_KEY_MATERIAL_KIND_PUBLIC_KEY"
}
Self::CODEC_KEY_MATERIAL_KIND_PRIVATE_KEY => {
"CODEC_KEY_MATERIAL_KIND_PRIVATE_KEY"
}
Self::CODEC_KEY_MATERIAL_KIND_SYMMETRIC_KEY => {
"CODEC_KEY_MATERIAL_KIND_SYMMETRIC_KEY"
}
Self::CODEC_KEY_MATERIAL_KIND_NOT_KEY => "CODEC_KEY_MATERIAL_KIND_NOT_KEY",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"CODEC_KEY_MATERIAL_KIND_UNSPECIFIED" => {
::core::option::Option::Some(Self::CODEC_KEY_MATERIAL_KIND_UNSPECIFIED)
}
"CODEC_KEY_MATERIAL_KIND_PUBLIC_KEY" => {
::core::option::Option::Some(Self::CODEC_KEY_MATERIAL_KIND_PUBLIC_KEY)
}
"CODEC_KEY_MATERIAL_KIND_PRIVATE_KEY" => {
::core::option::Option::Some(Self::CODEC_KEY_MATERIAL_KIND_PRIVATE_KEY)
}
"CODEC_KEY_MATERIAL_KIND_SYMMETRIC_KEY" => {
::core::option::Option::Some(Self::CODEC_KEY_MATERIAL_KIND_SYMMETRIC_KEY)
}
"CODEC_KEY_MATERIAL_KIND_NOT_KEY" => {
::core::option::Option::Some(Self::CODEC_KEY_MATERIAL_KIND_NOT_KEY)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::CODEC_KEY_MATERIAL_KIND_UNSPECIFIED,
Self::CODEC_KEY_MATERIAL_KIND_PUBLIC_KEY,
Self::CODEC_KEY_MATERIAL_KIND_PRIVATE_KEY,
Self::CODEC_KEY_MATERIAL_KIND_SYMMETRIC_KEY,
Self::CODEC_KEY_MATERIAL_KIND_NOT_KEY,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum CodecTag {
CODEC_TAG_UNSPECIFIED = 0i32,
CODEC_TAG_ENCRYPTION = 1i32,
CODEC_TAG_KEY = 2i32,
CODEC_TAG_HASH = 3i32,
CODEC_TAG_MULTIHASH = 4i32,
CODEC_TAG_MULTIKEY = 5i32,
}
impl CodecTag {
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::CODEC_TAG_UNSPECIFIED;
#[allow(non_upper_case_globals)]
pub const Encryption: Self = Self::CODEC_TAG_ENCRYPTION;
#[allow(non_upper_case_globals)]
pub const Key: Self = Self::CODEC_TAG_KEY;
#[allow(non_upper_case_globals)]
pub const Hash: Self = Self::CODEC_TAG_HASH;
#[allow(non_upper_case_globals)]
pub const Multihash: Self = Self::CODEC_TAG_MULTIHASH;
#[allow(non_upper_case_globals)]
pub const Multikey: Self = Self::CODEC_TAG_MULTIKEY;
}
impl ::core::default::Default for CodecTag {
fn default() -> Self {
Self::CODEC_TAG_UNSPECIFIED
}
}
impl ::serde::Serialize for CodecTag {
fn serialize<S: ::serde::Serializer>(
&self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
s.serialize_str(::buffa::Enumeration::proto_name(self))
}
}
impl<'de> ::serde::Deserialize<'de> for CodecTag {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = CodecTag;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!("a string, integer, or null for ", stringify!(CodecTag)),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<CodecTag, E> {
<CodecTag as ::buffa::Enumeration>::from_proto_name(v)
.ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
}
fn visit_i64<E: ::serde::de::Error>(
self,
v: i64,
) -> ::core::result::Result<CodecTag, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<CodecTag as ::buffa::Enumeration>::from_i32(v32)
.ok_or_else(|| {
::serde::de::Error::custom(
::buffa::alloc::format!("unknown enum value {v32}"),
)
})
}
fn visit_u64<E: ::serde::de::Error>(
self,
v: u64,
) -> ::core::result::Result<CodecTag, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<CodecTag as ::buffa::Enumeration>::from_i32(v32)
.ok_or_else(|| {
::serde::de::Error::custom(
::buffa::alloc::format!("unknown enum value {v32}"),
)
})
}
fn visit_unit<E: ::serde::de::Error>(
self,
) -> ::core::result::Result<CodecTag, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecTag {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
impl ::buffa::Enumeration for CodecTag {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::CODEC_TAG_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::CODEC_TAG_ENCRYPTION),
2i32 => ::core::option::Option::Some(Self::CODEC_TAG_KEY),
3i32 => ::core::option::Option::Some(Self::CODEC_TAG_HASH),
4i32 => ::core::option::Option::Some(Self::CODEC_TAG_MULTIHASH),
5i32 => ::core::option::Option::Some(Self::CODEC_TAG_MULTIKEY),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::CODEC_TAG_UNSPECIFIED => "CODEC_TAG_UNSPECIFIED",
Self::CODEC_TAG_ENCRYPTION => "CODEC_TAG_ENCRYPTION",
Self::CODEC_TAG_KEY => "CODEC_TAG_KEY",
Self::CODEC_TAG_HASH => "CODEC_TAG_HASH",
Self::CODEC_TAG_MULTIHASH => "CODEC_TAG_MULTIHASH",
Self::CODEC_TAG_MULTIKEY => "CODEC_TAG_MULTIKEY",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"CODEC_TAG_UNSPECIFIED" => {
::core::option::Option::Some(Self::CODEC_TAG_UNSPECIFIED)
}
"CODEC_TAG_ENCRYPTION" => {
::core::option::Option::Some(Self::CODEC_TAG_ENCRYPTION)
}
"CODEC_TAG_KEY" => ::core::option::Option::Some(Self::CODEC_TAG_KEY),
"CODEC_TAG_HASH" => ::core::option::Option::Some(Self::CODEC_TAG_HASH),
"CODEC_TAG_MULTIHASH" => {
::core::option::Option::Some(Self::CODEC_TAG_MULTIHASH)
}
"CODEC_TAG_MULTIKEY" => {
::core::option::Option::Some(Self::CODEC_TAG_MULTIKEY)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::CODEC_TAG_UNSPECIFIED,
Self::CODEC_TAG_ENCRYPTION,
Self::CODEC_TAG_KEY,
Self::CODEC_TAG_HASH,
Self::CODEC_TAG_MULTIHASH,
Self::CODEC_TAG_MULTIKEY,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum CodecErrorReason {
CODEC_ERROR_REASON_UNSPECIFIED = 0i32,
CODEC_ERROR_REASON_BASE_UNSUPPORTED_CODEC = 100i32,
CODEC_ERROR_REASON_BASE_INVALID_ENCODING = 101i32,
CODEC_ERROR_REASON_BASE_INVALID_LENGTH = 102i32,
CODEC_ERROR_REASON_BASE_INPUT_TOO_LARGE = 103i32,
CODEC_ERROR_REASON_BASE_OUTPUT_TOO_LARGE = 104i32,
CODEC_ERROR_REASON_BASE_INVALID_BASE64 = 110i32,
CODEC_ERROR_REASON_BASE_INVALID_BASE64URL = 111i32,
CODEC_ERROR_REASON_BASE_INVALID_HEX = 120i32,
CODEC_ERROR_REASON_BASE_NON_CANONICAL_HEX = 121i32,
CODEC_ERROR_REASON_PEM_INVALID_BOUNDARY = 200i32,
CODEC_ERROR_REASON_PEM_LABEL_MISMATCH = 201i32,
CODEC_ERROR_REASON_PEM_UNSUPPORTED_LABEL = 202i32,
CODEC_ERROR_REASON_PEM_INVALID_BODY = 203i32,
CODEC_ERROR_REASON_PEM_DER_TOO_LARGE = 204i32,
CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIBASE_PREFIX = 300i32,
CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTICODEC_PREFIX = 301i32,
CODEC_ERROR_REASON_MULTIFORMAT_UNKNOWN_MULTICODEC = 302i32,
CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIKEY = 303i32,
CODEC_ERROR_REASON_CANONICAL_INVALID_CBOR = 400i32,
CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_CBOR = 401i32,
CODEC_ERROR_REASON_CANONICAL_INVALID_JSON = 402i32,
CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_JSON = 403i32,
CODEC_ERROR_REASON_CANONICAL_INTERNAL = 404i32,
}
impl CodecErrorReason {
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::CODEC_ERROR_REASON_UNSPECIFIED;
#[allow(non_upper_case_globals)]
pub const BaseUnsupportedCodec: Self = Self::CODEC_ERROR_REASON_BASE_UNSUPPORTED_CODEC;
#[allow(non_upper_case_globals)]
pub const BaseInvalidEncoding: Self = Self::CODEC_ERROR_REASON_BASE_INVALID_ENCODING;
#[allow(non_upper_case_globals)]
pub const BaseInvalidLength: Self = Self::CODEC_ERROR_REASON_BASE_INVALID_LENGTH;
#[allow(non_upper_case_globals)]
pub const BaseInputTooLarge: Self = Self::CODEC_ERROR_REASON_BASE_INPUT_TOO_LARGE;
#[allow(non_upper_case_globals)]
pub const BaseOutputTooLarge: Self = Self::CODEC_ERROR_REASON_BASE_OUTPUT_TOO_LARGE;
#[allow(non_upper_case_globals)]
pub const BaseInvalidBase64: Self = Self::CODEC_ERROR_REASON_BASE_INVALID_BASE64;
#[allow(non_upper_case_globals)]
pub const BaseInvalidBase64url: Self = Self::CODEC_ERROR_REASON_BASE_INVALID_BASE64URL;
#[allow(non_upper_case_globals)]
pub const BaseInvalidHex: Self = Self::CODEC_ERROR_REASON_BASE_INVALID_HEX;
#[allow(non_upper_case_globals)]
pub const BaseNonCanonicalHex: Self = Self::CODEC_ERROR_REASON_BASE_NON_CANONICAL_HEX;
#[allow(non_upper_case_globals)]
pub const PemInvalidBoundary: Self = Self::CODEC_ERROR_REASON_PEM_INVALID_BOUNDARY;
#[allow(non_upper_case_globals)]
pub const PemLabelMismatch: Self = Self::CODEC_ERROR_REASON_PEM_LABEL_MISMATCH;
#[allow(non_upper_case_globals)]
pub const PemUnsupportedLabel: Self = Self::CODEC_ERROR_REASON_PEM_UNSUPPORTED_LABEL;
#[allow(non_upper_case_globals)]
pub const PemInvalidBody: Self = Self::CODEC_ERROR_REASON_PEM_INVALID_BODY;
#[allow(non_upper_case_globals)]
pub const PemDerTooLarge: Self = Self::CODEC_ERROR_REASON_PEM_DER_TOO_LARGE;
#[allow(non_upper_case_globals)]
pub const MultiformatInvalidMultibasePrefix: Self = Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIBASE_PREFIX;
#[allow(non_upper_case_globals)]
pub const MultiformatInvalidMulticodecPrefix: Self = Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTICODEC_PREFIX;
#[allow(non_upper_case_globals)]
pub const MultiformatUnknownMulticodec: Self = Self::CODEC_ERROR_REASON_MULTIFORMAT_UNKNOWN_MULTICODEC;
#[allow(non_upper_case_globals)]
pub const MultiformatInvalidMultikey: Self = Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIKEY;
#[allow(non_upper_case_globals)]
pub const CanonicalInvalidCbor: Self = Self::CODEC_ERROR_REASON_CANONICAL_INVALID_CBOR;
#[allow(non_upper_case_globals)]
pub const CanonicalNonCanonicalCbor: Self = Self::CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_CBOR;
#[allow(non_upper_case_globals)]
pub const CanonicalInvalidJson: Self = Self::CODEC_ERROR_REASON_CANONICAL_INVALID_JSON;
#[allow(non_upper_case_globals)]
pub const CanonicalNonCanonicalJson: Self = Self::CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_JSON;
#[allow(non_upper_case_globals)]
pub const CanonicalInternal: Self = Self::CODEC_ERROR_REASON_CANONICAL_INTERNAL;
}
impl ::core::default::Default for CodecErrorReason {
fn default() -> Self {
Self::CODEC_ERROR_REASON_UNSPECIFIED
}
}
impl ::serde::Serialize for CodecErrorReason {
fn serialize<S: ::serde::Serializer>(
&self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
s.serialize_str(::buffa::Enumeration::proto_name(self))
}
}
impl<'de> ::serde::Deserialize<'de> for CodecErrorReason {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = CodecErrorReason;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(CodecErrorReason)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<CodecErrorReason, E> {
<CodecErrorReason as ::buffa::Enumeration>::from_proto_name(v)
.ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
}
fn visit_i64<E: ::serde::de::Error>(
self,
v: i64,
) -> ::core::result::Result<CodecErrorReason, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<CodecErrorReason as ::buffa::Enumeration>::from_i32(v32)
.ok_or_else(|| {
::serde::de::Error::custom(
::buffa::alloc::format!("unknown enum value {v32}"),
)
})
}
fn visit_u64<E: ::serde::de::Error>(
self,
v: u64,
) -> ::core::result::Result<CodecErrorReason, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<CodecErrorReason as ::buffa::Enumeration>::from_i32(v32)
.ok_or_else(|| {
::serde::de::Error::custom(
::buffa::alloc::format!("unknown enum value {v32}"),
)
})
}
fn visit_unit<E: ::serde::de::Error>(
self,
) -> ::core::result::Result<CodecErrorReason, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecErrorReason {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
impl ::buffa::Enumeration for CodecErrorReason {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::CODEC_ERROR_REASON_UNSPECIFIED),
100i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_UNSUPPORTED_CODEC,
)
}
101i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_INVALID_ENCODING,
)
}
102i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_INVALID_LENGTH,
)
}
103i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_INPUT_TOO_LARGE,
)
}
104i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_OUTPUT_TOO_LARGE,
)
}
110i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_INVALID_BASE64,
)
}
111i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_INVALID_BASE64URL,
)
}
120i32 => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_BASE_INVALID_HEX)
}
121i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_NON_CANONICAL_HEX,
)
}
200i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_PEM_INVALID_BOUNDARY,
)
}
201i32 => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_PEM_LABEL_MISMATCH)
}
202i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_PEM_UNSUPPORTED_LABEL,
)
}
203i32 => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_PEM_INVALID_BODY)
}
204i32 => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_PEM_DER_TOO_LARGE)
}
300i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIBASE_PREFIX,
)
}
301i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTICODEC_PREFIX,
)
}
302i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_MULTIFORMAT_UNKNOWN_MULTICODEC,
)
}
303i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIKEY,
)
}
400i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_CANONICAL_INVALID_CBOR,
)
}
401i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_CBOR,
)
}
402i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_CANONICAL_INVALID_JSON,
)
}
403i32 => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_JSON,
)
}
404i32 => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_CANONICAL_INTERNAL)
}
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::CODEC_ERROR_REASON_UNSPECIFIED => "CODEC_ERROR_REASON_UNSPECIFIED",
Self::CODEC_ERROR_REASON_BASE_UNSUPPORTED_CODEC => {
"CODEC_ERROR_REASON_BASE_UNSUPPORTED_CODEC"
}
Self::CODEC_ERROR_REASON_BASE_INVALID_ENCODING => {
"CODEC_ERROR_REASON_BASE_INVALID_ENCODING"
}
Self::CODEC_ERROR_REASON_BASE_INVALID_LENGTH => {
"CODEC_ERROR_REASON_BASE_INVALID_LENGTH"
}
Self::CODEC_ERROR_REASON_BASE_INPUT_TOO_LARGE => {
"CODEC_ERROR_REASON_BASE_INPUT_TOO_LARGE"
}
Self::CODEC_ERROR_REASON_BASE_OUTPUT_TOO_LARGE => {
"CODEC_ERROR_REASON_BASE_OUTPUT_TOO_LARGE"
}
Self::CODEC_ERROR_REASON_BASE_INVALID_BASE64 => {
"CODEC_ERROR_REASON_BASE_INVALID_BASE64"
}
Self::CODEC_ERROR_REASON_BASE_INVALID_BASE64URL => {
"CODEC_ERROR_REASON_BASE_INVALID_BASE64URL"
}
Self::CODEC_ERROR_REASON_BASE_INVALID_HEX => {
"CODEC_ERROR_REASON_BASE_INVALID_HEX"
}
Self::CODEC_ERROR_REASON_BASE_NON_CANONICAL_HEX => {
"CODEC_ERROR_REASON_BASE_NON_CANONICAL_HEX"
}
Self::CODEC_ERROR_REASON_PEM_INVALID_BOUNDARY => {
"CODEC_ERROR_REASON_PEM_INVALID_BOUNDARY"
}
Self::CODEC_ERROR_REASON_PEM_LABEL_MISMATCH => {
"CODEC_ERROR_REASON_PEM_LABEL_MISMATCH"
}
Self::CODEC_ERROR_REASON_PEM_UNSUPPORTED_LABEL => {
"CODEC_ERROR_REASON_PEM_UNSUPPORTED_LABEL"
}
Self::CODEC_ERROR_REASON_PEM_INVALID_BODY => {
"CODEC_ERROR_REASON_PEM_INVALID_BODY"
}
Self::CODEC_ERROR_REASON_PEM_DER_TOO_LARGE => {
"CODEC_ERROR_REASON_PEM_DER_TOO_LARGE"
}
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIBASE_PREFIX => {
"CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIBASE_PREFIX"
}
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTICODEC_PREFIX => {
"CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTICODEC_PREFIX"
}
Self::CODEC_ERROR_REASON_MULTIFORMAT_UNKNOWN_MULTICODEC => {
"CODEC_ERROR_REASON_MULTIFORMAT_UNKNOWN_MULTICODEC"
}
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIKEY => {
"CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIKEY"
}
Self::CODEC_ERROR_REASON_CANONICAL_INVALID_CBOR => {
"CODEC_ERROR_REASON_CANONICAL_INVALID_CBOR"
}
Self::CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_CBOR => {
"CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_CBOR"
}
Self::CODEC_ERROR_REASON_CANONICAL_INVALID_JSON => {
"CODEC_ERROR_REASON_CANONICAL_INVALID_JSON"
}
Self::CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_JSON => {
"CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_JSON"
}
Self::CODEC_ERROR_REASON_CANONICAL_INTERNAL => {
"CODEC_ERROR_REASON_CANONICAL_INTERNAL"
}
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"CODEC_ERROR_REASON_UNSPECIFIED" => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_UNSPECIFIED)
}
"CODEC_ERROR_REASON_BASE_UNSUPPORTED_CODEC" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_UNSUPPORTED_CODEC,
)
}
"CODEC_ERROR_REASON_BASE_INVALID_ENCODING" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_INVALID_ENCODING,
)
}
"CODEC_ERROR_REASON_BASE_INVALID_LENGTH" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_INVALID_LENGTH,
)
}
"CODEC_ERROR_REASON_BASE_INPUT_TOO_LARGE" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_INPUT_TOO_LARGE,
)
}
"CODEC_ERROR_REASON_BASE_OUTPUT_TOO_LARGE" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_OUTPUT_TOO_LARGE,
)
}
"CODEC_ERROR_REASON_BASE_INVALID_BASE64" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_INVALID_BASE64,
)
}
"CODEC_ERROR_REASON_BASE_INVALID_BASE64URL" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_INVALID_BASE64URL,
)
}
"CODEC_ERROR_REASON_BASE_INVALID_HEX" => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_BASE_INVALID_HEX)
}
"CODEC_ERROR_REASON_BASE_NON_CANONICAL_HEX" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_BASE_NON_CANONICAL_HEX,
)
}
"CODEC_ERROR_REASON_PEM_INVALID_BOUNDARY" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_PEM_INVALID_BOUNDARY,
)
}
"CODEC_ERROR_REASON_PEM_LABEL_MISMATCH" => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_PEM_LABEL_MISMATCH)
}
"CODEC_ERROR_REASON_PEM_UNSUPPORTED_LABEL" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_PEM_UNSUPPORTED_LABEL,
)
}
"CODEC_ERROR_REASON_PEM_INVALID_BODY" => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_PEM_INVALID_BODY)
}
"CODEC_ERROR_REASON_PEM_DER_TOO_LARGE" => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_PEM_DER_TOO_LARGE)
}
"CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIBASE_PREFIX" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIBASE_PREFIX,
)
}
"CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTICODEC_PREFIX" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTICODEC_PREFIX,
)
}
"CODEC_ERROR_REASON_MULTIFORMAT_UNKNOWN_MULTICODEC" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_MULTIFORMAT_UNKNOWN_MULTICODEC,
)
}
"CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIKEY" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIKEY,
)
}
"CODEC_ERROR_REASON_CANONICAL_INVALID_CBOR" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_CANONICAL_INVALID_CBOR,
)
}
"CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_CBOR" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_CBOR,
)
}
"CODEC_ERROR_REASON_CANONICAL_INVALID_JSON" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_CANONICAL_INVALID_JSON,
)
}
"CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_JSON" => {
::core::option::Option::Some(
Self::CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_JSON,
)
}
"CODEC_ERROR_REASON_CANONICAL_INTERNAL" => {
::core::option::Option::Some(Self::CODEC_ERROR_REASON_CANONICAL_INTERNAL)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::CODEC_ERROR_REASON_UNSPECIFIED,
Self::CODEC_ERROR_REASON_BASE_UNSUPPORTED_CODEC,
Self::CODEC_ERROR_REASON_BASE_INVALID_ENCODING,
Self::CODEC_ERROR_REASON_BASE_INVALID_LENGTH,
Self::CODEC_ERROR_REASON_BASE_INPUT_TOO_LARGE,
Self::CODEC_ERROR_REASON_BASE_OUTPUT_TOO_LARGE,
Self::CODEC_ERROR_REASON_BASE_INVALID_BASE64,
Self::CODEC_ERROR_REASON_BASE_INVALID_BASE64URL,
Self::CODEC_ERROR_REASON_BASE_INVALID_HEX,
Self::CODEC_ERROR_REASON_BASE_NON_CANONICAL_HEX,
Self::CODEC_ERROR_REASON_PEM_INVALID_BOUNDARY,
Self::CODEC_ERROR_REASON_PEM_LABEL_MISMATCH,
Self::CODEC_ERROR_REASON_PEM_UNSUPPORTED_LABEL,
Self::CODEC_ERROR_REASON_PEM_INVALID_BODY,
Self::CODEC_ERROR_REASON_PEM_DER_TOO_LARGE,
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIBASE_PREFIX,
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTICODEC_PREFIX,
Self::CODEC_ERROR_REASON_MULTIFORMAT_UNKNOWN_MULTICODEC,
Self::CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIKEY,
Self::CODEC_ERROR_REASON_CANONICAL_INVALID_CBOR,
Self::CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_CBOR,
Self::CODEC_ERROR_REASON_CANONICAL_INVALID_JSON,
Self::CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_JSON,
Self::CODEC_ERROR_REASON_CANONICAL_INTERNAL,
]
}
}
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize)]
#[serde(default)]
pub struct CodecError {
#[serde(flatten)]
pub error: ::core::option::Option<__buffa::oneof::codec_error::Error>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecError {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecError").field("error", &self.error).finish()
}
}
impl CodecError {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecError";
}
::buffa::impl_default_instance!(CodecError);
impl ::buffa::MessageName for CodecError {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecError";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecError";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecError";
}
impl ::buffa::Message for CodecError {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let ::core::option::Option::Some(ref v) = self.error {
match v {
__buffa::oneof::codec_error::Error::BaseEncoding(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::codec_error::Error::Pem(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::codec_error::Error::Multiformat(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::codec_error::Error::Canonicalization(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
}
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let ::core::option::Option::Some(ref v) = self.error {
match v {
__buffa::oneof::codec_error::Error::BaseEncoding(x) => {
::buffa::types::put_len_delimited_header(
1u32,
__cache.consume_next(),
buf,
);
x.write_to(__cache, buf);
}
__buffa::oneof::codec_error::Error::Pem(x) => {
::buffa::types::put_len_delimited_header(
2u32,
__cache.consume_next(),
buf,
);
x.write_to(__cache, buf);
}
__buffa::oneof::codec_error::Error::Multiformat(x) => {
::buffa::types::put_len_delimited_header(
3u32,
__cache.consume_next(),
buf,
);
x.write_to(__cache, buf);
}
__buffa::oneof::codec_error::Error::Canonicalization(x) => {
::buffa::types::put_len_delimited_header(
4u32,
__cache.consume_next(),
buf,
);
x.write_to(__cache, buf);
}
}
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
__buffa::oneof::codec_error::Error::BaseEncoding(ref mut existing),
) = self.error
{
::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.error = ::core::option::Option::Some(
__buffa::oneof::codec_error::Error::BaseEncoding(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
__buffa::oneof::codec_error::Error::Pem(ref mut existing),
) = self.error
{
::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.error = ::core::option::Option::Some(
__buffa::oneof::codec_error::Error::Pem(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
__buffa::oneof::codec_error::Error::Multiformat(ref mut existing),
) = self.error
{
::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.error = ::core::option::Option::Some(
__buffa::oneof::codec_error::Error::Multiformat(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
__buffa::oneof::codec_error::Error::Canonicalization(
ref mut existing,
),
) = self.error
{
::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.error = ::core::option::Option::Some(
__buffa::oneof::codec_error::Error::Canonicalization(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.error = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecError {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecError";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl<'de> serde::Deserialize<'de> for CodecError {
fn deserialize<D: serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl<'de> serde::de::Visitor<'de> for _V {
type Value = CodecError;
fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("struct CodecError")
}
#[allow(clippy::field_reassign_with_default)]
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
mut map: A,
) -> ::core::result::Result<CodecError, A::Error> {
let mut __oneof_error: ::core::option::Option<
__buffa::oneof::codec_error::Error,
> = None;
while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
match key.as_str() {
"baseEncoding" | "base_encoding" => {
let v: ::core::option::Option<CodecBaseEncodingError> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
CodecBaseEncodingError,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_error.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'error'",
),
);
}
__oneof_error = Some(
__buffa::oneof::codec_error::Error::BaseEncoding(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"pem" => {
let v: ::core::option::Option<CodecPemError> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
CodecPemError,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_error.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'error'",
),
);
}
__oneof_error = Some(
__buffa::oneof::codec_error::Error::Pem(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"multiformat" => {
let v: ::core::option::Option<CodecMultiformatError> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
CodecMultiformatError,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_error.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'error'",
),
);
}
__oneof_error = Some(
__buffa::oneof::codec_error::Error::Multiformat(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"canonicalization" => {
let v: ::core::option::Option<CodecCanonicalizationError> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
CodecCanonicalizationError,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_error.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'error'",
),
);
}
__oneof_error = Some(
__buffa::oneof::codec_error::Error::Canonicalization(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
_ => {
map.next_value::<serde::de::IgnoredAny>()?;
}
}
}
let mut __r = <CodecError as ::core::default::Default>::default();
__r.error = __oneof_error;
Ok(__r)
}
}
d.deserialize_map(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecError {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_ERROR_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecError",
to_json: ::buffa::type_registry::any_to_json::<CodecError>,
from_json: ::buffa::type_registry::any_from_json::<CodecError>,
is_wkt: false,
};
pub mod codec_error {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::codec_error::Error;
#[doc(inline)]
pub use super::__buffa::view::oneof::codec_error::Error as ErrorView;
}
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CodecMulticodecSpec {
#[serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub name: ::buffa::alloc::string::String,
#[serde(
rename = "code",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)]
pub code: ::buffa::alloc::vec::Vec<u8>,
#[serde(
rename = "prefix",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)]
pub prefix: ::buffa::alloc::vec::Vec<u8>,
#[serde(
rename = "tag",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)]
pub tag: ::buffa::EnumValue<CodecTag>,
#[serde(
rename = "keyMaterialKind",
alias = "key_material_kind",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)]
pub key_material_kind: ::buffa::EnumValue<CodecKeyMaterialKind>,
#[serde(
rename = "fixedLength",
alias = "fixed_length",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub fixed_length: u32,
#[serde(
rename = "variableLength",
alias = "variable_length",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)]
pub variable_length: bool,
#[serde(
rename = "algorithmName",
alias = "algorithm_name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub algorithm_name: ::buffa::alloc::string::String,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecMulticodecSpec {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecMulticodecSpec")
.field("name", &self.name)
.field("code", &self.code)
.field("prefix", &self.prefix)
.field("tag", &self.tag)
.field("key_material_kind", &self.key_material_kind)
.field("fixed_length", &self.fixed_length)
.field("variable_length", &self.variable_length)
.field("algorithm_name", &self.algorithm_name)
.finish()
}
}
impl CodecMulticodecSpec {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecMulticodecSpec";
}
::buffa::impl_default_instance!(CodecMulticodecSpec);
impl ::buffa::MessageName for CodecMulticodecSpec {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecMulticodecSpec";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecMulticodecSpec";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecMulticodecSpec";
}
impl ::buffa::Message for CodecMulticodecSpec {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.code.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.code) as u32;
}
if !self.prefix.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.prefix) as u32;
}
{
let val = self.tag.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
{
let val = self.key_material_kind.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.fixed_length != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.fixed_length) as u32;
}
if self.variable_length {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.algorithm_name.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.algorithm_name) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::types::put_string_field(1u32, &self.name, buf);
}
if !self.code.is_empty() {
::buffa::types::put_bytes_field(2u32, &self.code, buf);
}
if !self.prefix.is_empty() {
::buffa::types::put_bytes_field(3u32, &self.prefix, buf);
}
{
let val = self.tag.to_i32();
if val != 0 {
::buffa::types::put_int32_field(4u32, val, buf);
}
}
{
let val = self.key_material_kind.to_i32();
if val != 0 {
::buffa::types::put_int32_field(5u32, val, buf);
}
}
if self.fixed_length != 0u32 {
::buffa::types::put_uint32_field(6u32, self.fixed_length, buf);
}
if self.variable_length {
::buffa::types::put_bool_field(7u32, self.variable_length, buf);
}
if !self.algorithm_name.is_empty() {
::buffa::types::put_string_field(8u32, &self.algorithm_name, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.name, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.code, buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.prefix, buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.tag = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.key_material_kind = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
6u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.fixed_length = ::buffa::types::decode_uint32(buf)?;
}
7u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.variable_length = ::buffa::types::decode_bool(buf)?;
}
8u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.algorithm_name, buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name.clear();
self.code.clear();
self.prefix.clear();
self.tag = ::buffa::EnumValue::from(0);
self.key_material_kind = ::buffa::EnumValue::from(0);
self.fixed_length = 0u32;
self.variable_length = false;
self.algorithm_name.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecMulticodecSpec {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecMulticodecSpec";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecMulticodecSpec {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_MULTICODEC_SPEC_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecMulticodecSpec",
to_json: ::buffa::type_registry::any_to_json::<CodecMulticodecSpec>,
from_json: ::buffa::type_registry::any_from_json::<CodecMulticodecSpec>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CodecMulticodecLookupResult {
#[serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub name: ::buffa::alloc::string::String,
#[serde(
rename = "prefixLength",
alias = "prefix_length",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub prefix_length: u32,
#[serde(
rename = "metadata",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)]
pub metadata: ::buffa::MessageField<CodecMulticodecSpec>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecMulticodecLookupResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecMulticodecLookupResult")
.field("name", &self.name)
.field("prefix_length", &self.prefix_length)
.field("metadata", &self.metadata)
.finish()
}
}
impl CodecMulticodecLookupResult {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecMulticodecLookupResult";
}
::buffa::impl_default_instance!(CodecMulticodecLookupResult);
impl ::buffa::MessageName for CodecMulticodecLookupResult {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecMulticodecLookupResult";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecMulticodecLookupResult";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecMulticodecLookupResult";
}
impl ::buffa::Message for CodecMulticodecLookupResult {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if self.prefix_length != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.prefix_length) as u32;
}
if self.metadata.is_set() {
let __slot = __cache.reserve();
let inner_size = self.metadata.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::types::put_string_field(1u32, &self.name, buf);
}
if self.prefix_length != 0u32 {
::buffa::types::put_uint32_field(2u32, self.prefix_length, buf);
}
if self.metadata.is_set() {
::buffa::types::put_len_delimited_header(3u32, __cache.consume_next(), buf);
self.metadata.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.name, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.prefix_length = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.metadata.get_or_insert_default(),
buf,
ctx,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name.clear();
self.prefix_length = 0u32;
self.metadata = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecMulticodecLookupResult {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecMulticodecLookupResult";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecMulticodecLookupResult {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_MULTICODEC_LOOKUP_RESULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecMulticodecLookupResult",
to_json: ::buffa::type_registry::any_to_json::<CodecMulticodecLookupResult>,
from_json: ::buffa::type_registry::any_from_json::<CodecMulticodecLookupResult>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CodecMulticodecTableResult {
#[serde(
rename = "entries",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub entries: ::buffa::alloc::vec::Vec<CodecMulticodecSpec>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecMulticodecTableResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecMulticodecTableResult")
.field("entries", &self.entries)
.finish()
}
}
impl CodecMulticodecTableResult {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecMulticodecTableResult";
}
::buffa::impl_default_instance!(CodecMulticodecTableResult);
impl ::buffa::MessageName for CodecMulticodecTableResult {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecMulticodecTableResult";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecMulticodecTableResult";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecMulticodecTableResult";
}
impl ::buffa::Message for CodecMulticodecTableResult {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.entries {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.entries {
::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
v.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.entries.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.entries.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecMulticodecTableResult {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecMulticodecTableResult";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecMulticodecTableResult {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_MULTICODEC_TABLE_RESULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecMulticodecTableResult",
to_json: ::buffa::type_registry::any_to_json::<CodecMulticodecTableResult>,
from_json: ::buffa::type_registry::any_from_json::<CodecMulticodecTableResult>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CodecMultikeyParseResult {
#[serde(
rename = "codecName",
alias = "codec_name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub codec_name: ::buffa::alloc::string::String,
#[serde(
rename = "algorithmName",
alias = "algorithm_name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub algorithm_name: ::buffa::alloc::string::String,
#[serde(
rename = "publicKey",
alias = "public_key",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)]
pub public_key: ::buffa::alloc::vec::Vec<u8>,
#[serde(
rename = "expectedPublicKeyLength",
alias = "expected_public_key_length",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub expected_public_key_length: u32,
#[serde(
rename = "variablePublicKeyLength",
alias = "variable_public_key_length",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)]
pub variable_public_key_length: bool,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecMultikeyParseResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecMultikeyParseResult")
.field("codec_name", &self.codec_name)
.field("algorithm_name", &self.algorithm_name)
.field("public_key", &self.public_key)
.field("expected_public_key_length", &self.expected_public_key_length)
.field("variable_public_key_length", &self.variable_public_key_length)
.finish()
}
}
impl CodecMultikeyParseResult {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecMultikeyParseResult";
}
::buffa::impl_default_instance!(CodecMultikeyParseResult);
impl ::buffa::MessageName for CodecMultikeyParseResult {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecMultikeyParseResult";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecMultikeyParseResult";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecMultikeyParseResult";
}
impl ::buffa::Message for CodecMultikeyParseResult {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.codec_name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.codec_name) as u32;
}
if !self.algorithm_name.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.algorithm_name) as u32;
}
if !self.public_key.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.public_key) as u32;
}
if self.expected_public_key_length != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.expected_public_key_length)
as u32;
}
if self.variable_public_key_length {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.codec_name.is_empty() {
::buffa::types::put_string_field(1u32, &self.codec_name, buf);
}
if !self.algorithm_name.is_empty() {
::buffa::types::put_string_field(2u32, &self.algorithm_name, buf);
}
if !self.public_key.is_empty() {
::buffa::types::put_bytes_field(3u32, &self.public_key, buf);
}
if self.expected_public_key_length != 0u32 {
::buffa::types::put_uint32_field(4u32, self.expected_public_key_length, buf);
}
if self.variable_public_key_length {
::buffa::types::put_bool_field(5u32, self.variable_public_key_length, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.codec_name, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.algorithm_name, buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.public_key, buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.expected_public_key_length = ::buffa::types::decode_uint32(buf)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.variable_public_key_length = ::buffa::types::decode_bool(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.codec_name.clear();
self.algorithm_name.clear();
self.public_key.clear();
self.expected_public_key_length = 0u32;
self.variable_public_key_length = false;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecMultikeyParseResult {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecMultikeyParseResult";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecMultikeyParseResult {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_MULTIKEY_PARSE_RESULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecMultikeyParseResult",
to_json: ::buffa::type_registry::any_to_json::<CodecMultikeyParseResult>,
from_json: ::buffa::type_registry::any_from_json::<CodecMultikeyParseResult>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CodecDagCborVerifyCidResult {
#[serde(
rename = "valid",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)]
pub valid: bool,
#[serde(
rename = "expectedCid",
alias = "expected_cid",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub expected_cid: ::buffa::alloc::string::String,
#[serde(
rename = "actualCid",
alias = "actual_cid",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub actual_cid: ::buffa::alloc::string::String,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecDagCborVerifyCidResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecDagCborVerifyCidResult")
.field("valid", &self.valid)
.field("expected_cid", &self.expected_cid)
.field("actual_cid", &self.actual_cid)
.finish()
}
}
impl CodecDagCborVerifyCidResult {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecDagCborVerifyCidResult";
}
::buffa::impl_default_instance!(CodecDagCborVerifyCidResult);
impl ::buffa::MessageName for CodecDagCborVerifyCidResult {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecDagCborVerifyCidResult";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecDagCborVerifyCidResult";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecDagCborVerifyCidResult";
}
impl ::buffa::Message for CodecDagCborVerifyCidResult {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if self.valid {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.expected_cid.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.expected_cid) as u32;
}
if !self.actual_cid.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.actual_cid) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.valid {
::buffa::types::put_bool_field(1u32, self.valid, buf);
}
if !self.expected_cid.is_empty() {
::buffa::types::put_string_field(2u32, &self.expected_cid, buf);
}
if !self.actual_cid.is_empty() {
::buffa::types::put_string_field(3u32, &self.actual_cid, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.valid = ::buffa::types::decode_bool(buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.expected_cid, buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.actual_cid, buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.valid = false;
self.expected_cid.clear();
self.actual_cid.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecDagCborVerifyCidResult {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecDagCborVerifyCidResult";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecDagCborVerifyCidResult {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_DAG_CBOR_VERIFY_CID_RESULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecDagCborVerifyCidResult",
to_json: ::buffa::type_registry::any_to_json::<CodecDagCborVerifyCidResult>,
from_json: ::buffa::type_registry::any_from_json::<CodecDagCborVerifyCidResult>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CodecPemDecodeResult {
#[serde(
rename = "label",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub label: ::buffa::alloc::string::String,
#[serde(
rename = "der",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)]
pub der: ::buffa::alloc::vec::Vec<u8>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecPemDecodeResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecPemDecodeResult")
.field("label", &self.label)
.field("der", &self.der)
.finish()
}
}
impl CodecPemDecodeResult {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecPemDecodeResult";
}
::buffa::impl_default_instance!(CodecPemDecodeResult);
impl ::buffa::MessageName for CodecPemDecodeResult {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecPemDecodeResult";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecPemDecodeResult";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecPemDecodeResult";
}
impl ::buffa::Message for CodecPemDecodeResult {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.label.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.label) as u32;
}
if !self.der.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.der) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.label.is_empty() {
::buffa::types::put_string_field(1u32, &self.label, buf);
}
if !self.der.is_empty() {
::buffa::types::put_bytes_field(2u32, &self.der, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.label, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.der, buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.label.clear();
self.der.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecPemDecodeResult {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecPemDecodeResult";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecPemDecodeResult {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_PEM_DECODE_RESULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecPemDecodeResult",
to_json: ::buffa::type_registry::any_to_json::<CodecPemDecodeResult>,
from_json: ::buffa::type_registry::any_from_json::<CodecPemDecodeResult>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CodecBaseEncodingError {
#[serde(
rename = "reason",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)]
pub reason: ::buffa::EnumValue<CodecErrorReason>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecBaseEncodingError {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecBaseEncodingError").field("reason", &self.reason).finish()
}
}
impl CodecBaseEncodingError {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecBaseEncodingError";
}
::buffa::impl_default_instance!(CodecBaseEncodingError);
impl ::buffa::MessageName for CodecBaseEncodingError {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecBaseEncodingError";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecBaseEncodingError";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecBaseEncodingError";
}
impl ::buffa::Message for CodecBaseEncodingError {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
{
let val = self.reason.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
{
let val = self.reason.to_i32();
if val != 0 {
::buffa::types::put_int32_field(1u32, val, buf);
}
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.reason = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.reason = ::buffa::EnumValue::from(0);
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecBaseEncodingError {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecBaseEncodingError";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecBaseEncodingError {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_BASE_ENCODING_ERROR_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecBaseEncodingError",
to_json: ::buffa::type_registry::any_to_json::<CodecBaseEncodingError>,
from_json: ::buffa::type_registry::any_from_json::<CodecBaseEncodingError>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CodecPemError {
#[serde(
rename = "reason",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)]
pub reason: ::buffa::EnumValue<CodecErrorReason>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecPemError {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecPemError").field("reason", &self.reason).finish()
}
}
impl CodecPemError {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecPemError";
}
::buffa::impl_default_instance!(CodecPemError);
impl ::buffa::MessageName for CodecPemError {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecPemError";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecPemError";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecPemError";
}
impl ::buffa::Message for CodecPemError {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
{
let val = self.reason.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
{
let val = self.reason.to_i32();
if val != 0 {
::buffa::types::put_int32_field(1u32, val, buf);
}
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.reason = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.reason = ::buffa::EnumValue::from(0);
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecPemError {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecPemError";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecPemError {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_PEM_ERROR_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecPemError",
to_json: ::buffa::type_registry::any_to_json::<CodecPemError>,
from_json: ::buffa::type_registry::any_from_json::<CodecPemError>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CodecMultiformatError {
#[serde(
rename = "reason",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)]
pub reason: ::buffa::EnumValue<CodecErrorReason>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecMultiformatError {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecMultiformatError").field("reason", &self.reason).finish()
}
}
impl CodecMultiformatError {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecMultiformatError";
}
::buffa::impl_default_instance!(CodecMultiformatError);
impl ::buffa::MessageName for CodecMultiformatError {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecMultiformatError";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecMultiformatError";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecMultiformatError";
}
impl ::buffa::Message for CodecMultiformatError {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
{
let val = self.reason.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
{
let val = self.reason.to_i32();
if val != 0 {
::buffa::types::put_int32_field(1u32, val, buf);
}
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.reason = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.reason = ::buffa::EnumValue::from(0);
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecMultiformatError {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecMultiformatError";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecMultiformatError {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_MULTIFORMAT_ERROR_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecMultiformatError",
to_json: ::buffa::type_registry::any_to_json::<CodecMultiformatError>,
from_json: ::buffa::type_registry::any_from_json::<CodecMultiformatError>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CodecCanonicalizationError {
#[serde(
rename = "reason",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)]
pub reason: ::buffa::EnumValue<CodecErrorReason>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecCanonicalizationError {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecCanonicalizationError")
.field("reason", &self.reason)
.finish()
}
}
impl CodecCanonicalizationError {
pub const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecCanonicalizationError";
}
::buffa::impl_default_instance!(CodecCanonicalizationError);
impl ::buffa::MessageName for CodecCanonicalizationError {
const PACKAGE: &'static str = "reallyme.codec.v1";
const NAME: &'static str = "CodecCanonicalizationError";
const FULL_NAME: &'static str = "reallyme.codec.v1.CodecCanonicalizationError";
const TYPE_URL: &'static str = "type.googleapis.com/reallyme.codec.v1.CodecCanonicalizationError";
}
impl ::buffa::Message for CodecCanonicalizationError {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
{
let val = self.reason.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
{
let val = self.reason.to_i32();
if val != 0 {
::buffa::types::put_int32_field(1u32, val, buf);
}
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.reason = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.reason = ::buffa::EnumValue::from(0);
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecCanonicalizationError {
const PROTO_FQN: &'static str = "reallyme.codec.v1.CodecCanonicalizationError";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CodecCanonicalizationError {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CODEC_CANONICALIZATION_ERROR_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/reallyme.codec.v1.CodecCanonicalizationError",
to_json: ::buffa::type_registry::any_to_json::<CodecCanonicalizationError>,
from_json: ::buffa::type_registry::any_from_json::<CodecCanonicalizationError>,
is_wkt: false,
};