// @generated by buffa-codegen. DO NOT EDIT.
// source: media/v1/types.proto
/// Container/video file format.
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum VideoFormat {
VIDEO_FORMAT_UNSPECIFIED = 0i32,
VIDEO_FORMAT_AVI = 1i32,
VIDEO_FORMAT_FLV = 2i32,
VIDEO_FORMAT_MP4 = 3i32,
VIDEO_FORMAT_M4V = 4i32,
VIDEO_FORMAT_MKV = 5i32,
VIDEO_FORMAT_MOV = 6i32,
VIDEO_FORMAT_MXF = 7i32,
VIDEO_FORMAT_MTS = 8i32,
VIDEO_FORMAT_TS = 9i32,
VIDEO_FORMAT_WMV = 10i32,
VIDEO_FORMAT_WEBM = 11i32,
}
impl VideoFormat {
///Idiomatic alias for [`Self::VIDEO_FORMAT_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::VIDEO_FORMAT_UNSPECIFIED;
///Idiomatic alias for [`Self::VIDEO_FORMAT_AVI`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Avi: Self = Self::VIDEO_FORMAT_AVI;
///Idiomatic alias for [`Self::VIDEO_FORMAT_FLV`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Flv: Self = Self::VIDEO_FORMAT_FLV;
///Idiomatic alias for [`Self::VIDEO_FORMAT_MP4`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mp4: Self = Self::VIDEO_FORMAT_MP4;
///Idiomatic alias for [`Self::VIDEO_FORMAT_M4V`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const M4v: Self = Self::VIDEO_FORMAT_M4V;
///Idiomatic alias for [`Self::VIDEO_FORMAT_MKV`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mkv: Self = Self::VIDEO_FORMAT_MKV;
///Idiomatic alias for [`Self::VIDEO_FORMAT_MOV`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mov: Self = Self::VIDEO_FORMAT_MOV;
///Idiomatic alias for [`Self::VIDEO_FORMAT_MXF`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mxf: Self = Self::VIDEO_FORMAT_MXF;
///Idiomatic alias for [`Self::VIDEO_FORMAT_MTS`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mts: Self = Self::VIDEO_FORMAT_MTS;
///Idiomatic alias for [`Self::VIDEO_FORMAT_TS`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ts: Self = Self::VIDEO_FORMAT_TS;
///Idiomatic alias for [`Self::VIDEO_FORMAT_WMV`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Wmv: Self = Self::VIDEO_FORMAT_WMV;
///Idiomatic alias for [`Self::VIDEO_FORMAT_WEBM`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Webm: Self = Self::VIDEO_FORMAT_WEBM;
}
impl ::core::default::Default for VideoFormat {
fn default() -> Self {
Self::VIDEO_FORMAT_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for VideoFormat {
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 VideoFormat {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = VideoFormat;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(VideoFormat)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<VideoFormat, E> {
<VideoFormat 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<VideoFormat, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<VideoFormat 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<VideoFormat, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<VideoFormat 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<VideoFormat, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for VideoFormat {
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 VideoFormat {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_AVI),
2i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_FLV),
3i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_MP4),
4i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_M4V),
5i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_MKV),
6i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_MOV),
7i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_MXF),
8i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_MTS),
9i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_TS),
10i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_WMV),
11i32 => ::core::option::Option::Some(Self::VIDEO_FORMAT_WEBM),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::VIDEO_FORMAT_UNSPECIFIED => "VIDEO_FORMAT_UNSPECIFIED",
Self::VIDEO_FORMAT_AVI => "VIDEO_FORMAT_AVI",
Self::VIDEO_FORMAT_FLV => "VIDEO_FORMAT_FLV",
Self::VIDEO_FORMAT_MP4 => "VIDEO_FORMAT_MP4",
Self::VIDEO_FORMAT_M4V => "VIDEO_FORMAT_M4V",
Self::VIDEO_FORMAT_MKV => "VIDEO_FORMAT_MKV",
Self::VIDEO_FORMAT_MOV => "VIDEO_FORMAT_MOV",
Self::VIDEO_FORMAT_MXF => "VIDEO_FORMAT_MXF",
Self::VIDEO_FORMAT_MTS => "VIDEO_FORMAT_MTS",
Self::VIDEO_FORMAT_TS => "VIDEO_FORMAT_TS",
Self::VIDEO_FORMAT_WMV => "VIDEO_FORMAT_WMV",
Self::VIDEO_FORMAT_WEBM => "VIDEO_FORMAT_WEBM",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"VIDEO_FORMAT_UNSPECIFIED" => {
::core::option::Option::Some(Self::VIDEO_FORMAT_UNSPECIFIED)
}
"VIDEO_FORMAT_AVI" => ::core::option::Option::Some(Self::VIDEO_FORMAT_AVI),
"VIDEO_FORMAT_FLV" => ::core::option::Option::Some(Self::VIDEO_FORMAT_FLV),
"VIDEO_FORMAT_MP4" => ::core::option::Option::Some(Self::VIDEO_FORMAT_MP4),
"VIDEO_FORMAT_M4V" => ::core::option::Option::Some(Self::VIDEO_FORMAT_M4V),
"VIDEO_FORMAT_MKV" => ::core::option::Option::Some(Self::VIDEO_FORMAT_MKV),
"VIDEO_FORMAT_MOV" => ::core::option::Option::Some(Self::VIDEO_FORMAT_MOV),
"VIDEO_FORMAT_MXF" => ::core::option::Option::Some(Self::VIDEO_FORMAT_MXF),
"VIDEO_FORMAT_MTS" => ::core::option::Option::Some(Self::VIDEO_FORMAT_MTS),
"VIDEO_FORMAT_TS" => ::core::option::Option::Some(Self::VIDEO_FORMAT_TS),
"VIDEO_FORMAT_WMV" => ::core::option::Option::Some(Self::VIDEO_FORMAT_WMV),
"VIDEO_FORMAT_WEBM" => ::core::option::Option::Some(Self::VIDEO_FORMAT_WEBM),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::VIDEO_FORMAT_UNSPECIFIED,
Self::VIDEO_FORMAT_AVI,
Self::VIDEO_FORMAT_FLV,
Self::VIDEO_FORMAT_MP4,
Self::VIDEO_FORMAT_M4V,
Self::VIDEO_FORMAT_MKV,
Self::VIDEO_FORMAT_MOV,
Self::VIDEO_FORMAT_MXF,
Self::VIDEO_FORMAT_MTS,
Self::VIDEO_FORMAT_TS,
Self::VIDEO_FORMAT_WMV,
Self::VIDEO_FORMAT_WEBM,
]
}
}
/// Audio file format.
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum AudioFormat {
AUDIO_FORMAT_UNSPECIFIED = 0i32,
AUDIO_FORMAT_MP3 = 1i32,
AUDIO_FORMAT_AAC = 2i32,
AUDIO_FORMAT_FLAC = 3i32,
AUDIO_FORMAT_WAV = 4i32,
AUDIO_FORMAT_OGG = 5i32,
AUDIO_FORMAT_WMA = 6i32,
AUDIO_FORMAT_M4A = 7i32,
AUDIO_FORMAT_OPUS = 8i32,
AUDIO_FORMAT_AIFF = 9i32,
}
impl AudioFormat {
///Idiomatic alias for [`Self::AUDIO_FORMAT_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::AUDIO_FORMAT_UNSPECIFIED;
///Idiomatic alias for [`Self::AUDIO_FORMAT_MP3`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mp3: Self = Self::AUDIO_FORMAT_MP3;
///Idiomatic alias for [`Self::AUDIO_FORMAT_AAC`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Aac: Self = Self::AUDIO_FORMAT_AAC;
///Idiomatic alias for [`Self::AUDIO_FORMAT_FLAC`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Flac: Self = Self::AUDIO_FORMAT_FLAC;
///Idiomatic alias for [`Self::AUDIO_FORMAT_WAV`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Wav: Self = Self::AUDIO_FORMAT_WAV;
///Idiomatic alias for [`Self::AUDIO_FORMAT_OGG`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ogg: Self = Self::AUDIO_FORMAT_OGG;
///Idiomatic alias for [`Self::AUDIO_FORMAT_WMA`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Wma: Self = Self::AUDIO_FORMAT_WMA;
///Idiomatic alias for [`Self::AUDIO_FORMAT_M4A`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const M4a: Self = Self::AUDIO_FORMAT_M4A;
///Idiomatic alias for [`Self::AUDIO_FORMAT_OPUS`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Opus: Self = Self::AUDIO_FORMAT_OPUS;
///Idiomatic alias for [`Self::AUDIO_FORMAT_AIFF`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Aiff: Self = Self::AUDIO_FORMAT_AIFF;
}
impl ::core::default::Default for AudioFormat {
fn default() -> Self {
Self::AUDIO_FORMAT_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for AudioFormat {
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 AudioFormat {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = AudioFormat;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(AudioFormat)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<AudioFormat, E> {
<AudioFormat 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<AudioFormat, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioFormat 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<AudioFormat, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioFormat 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<AudioFormat, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for AudioFormat {
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 AudioFormat {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::AUDIO_FORMAT_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::AUDIO_FORMAT_MP3),
2i32 => ::core::option::Option::Some(Self::AUDIO_FORMAT_AAC),
3i32 => ::core::option::Option::Some(Self::AUDIO_FORMAT_FLAC),
4i32 => ::core::option::Option::Some(Self::AUDIO_FORMAT_WAV),
5i32 => ::core::option::Option::Some(Self::AUDIO_FORMAT_OGG),
6i32 => ::core::option::Option::Some(Self::AUDIO_FORMAT_WMA),
7i32 => ::core::option::Option::Some(Self::AUDIO_FORMAT_M4A),
8i32 => ::core::option::Option::Some(Self::AUDIO_FORMAT_OPUS),
9i32 => ::core::option::Option::Some(Self::AUDIO_FORMAT_AIFF),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::AUDIO_FORMAT_UNSPECIFIED => "AUDIO_FORMAT_UNSPECIFIED",
Self::AUDIO_FORMAT_MP3 => "AUDIO_FORMAT_MP3",
Self::AUDIO_FORMAT_AAC => "AUDIO_FORMAT_AAC",
Self::AUDIO_FORMAT_FLAC => "AUDIO_FORMAT_FLAC",
Self::AUDIO_FORMAT_WAV => "AUDIO_FORMAT_WAV",
Self::AUDIO_FORMAT_OGG => "AUDIO_FORMAT_OGG",
Self::AUDIO_FORMAT_WMA => "AUDIO_FORMAT_WMA",
Self::AUDIO_FORMAT_M4A => "AUDIO_FORMAT_M4A",
Self::AUDIO_FORMAT_OPUS => "AUDIO_FORMAT_OPUS",
Self::AUDIO_FORMAT_AIFF => "AUDIO_FORMAT_AIFF",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"AUDIO_FORMAT_UNSPECIFIED" => {
::core::option::Option::Some(Self::AUDIO_FORMAT_UNSPECIFIED)
}
"AUDIO_FORMAT_MP3" => ::core::option::Option::Some(Self::AUDIO_FORMAT_MP3),
"AUDIO_FORMAT_AAC" => ::core::option::Option::Some(Self::AUDIO_FORMAT_AAC),
"AUDIO_FORMAT_FLAC" => ::core::option::Option::Some(Self::AUDIO_FORMAT_FLAC),
"AUDIO_FORMAT_WAV" => ::core::option::Option::Some(Self::AUDIO_FORMAT_WAV),
"AUDIO_FORMAT_OGG" => ::core::option::Option::Some(Self::AUDIO_FORMAT_OGG),
"AUDIO_FORMAT_WMA" => ::core::option::Option::Some(Self::AUDIO_FORMAT_WMA),
"AUDIO_FORMAT_M4A" => ::core::option::Option::Some(Self::AUDIO_FORMAT_M4A),
"AUDIO_FORMAT_OPUS" => ::core::option::Option::Some(Self::AUDIO_FORMAT_OPUS),
"AUDIO_FORMAT_AIFF" => ::core::option::Option::Some(Self::AUDIO_FORMAT_AIFF),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::AUDIO_FORMAT_UNSPECIFIED,
Self::AUDIO_FORMAT_MP3,
Self::AUDIO_FORMAT_AAC,
Self::AUDIO_FORMAT_FLAC,
Self::AUDIO_FORMAT_WAV,
Self::AUDIO_FORMAT_OGG,
Self::AUDIO_FORMAT_WMA,
Self::AUDIO_FORMAT_M4A,
Self::AUDIO_FORMAT_OPUS,
Self::AUDIO_FORMAT_AIFF,
]
}
}
/// Whether a `Person`'s identification is user-confirmed or auto-matched.
/// Mirrors the domain `PersonConfidence` enum (see `schema/person.md`).
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum PersonConfidence {
PERSON_CONFIDENCE_AUTO_MATCHED = 0i32,
PERSON_CONFIDENCE_USER_CONFIRMED = 1i32,
}
impl PersonConfidence {
///Idiomatic alias for [`Self::PERSON_CONFIDENCE_AUTO_MATCHED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const AutoMatched: Self = Self::PERSON_CONFIDENCE_AUTO_MATCHED;
///Idiomatic alias for [`Self::PERSON_CONFIDENCE_USER_CONFIRMED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const UserConfirmed: Self = Self::PERSON_CONFIDENCE_USER_CONFIRMED;
}
impl ::core::default::Default for PersonConfidence {
fn default() -> Self {
Self::PERSON_CONFIDENCE_AUTO_MATCHED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for PersonConfidence {
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 PersonConfidence {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = PersonConfidence;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(PersonConfidence)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<PersonConfidence, E> {
<PersonConfidence 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<PersonConfidence, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<PersonConfidence 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<PersonConfidence, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<PersonConfidence 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<PersonConfidence, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for PersonConfidence {
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 PersonConfidence {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::PERSON_CONFIDENCE_AUTO_MATCHED),
1i32 => ::core::option::Option::Some(Self::PERSON_CONFIDENCE_USER_CONFIRMED),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::PERSON_CONFIDENCE_AUTO_MATCHED => "PERSON_CONFIDENCE_AUTO_MATCHED",
Self::PERSON_CONFIDENCE_USER_CONFIRMED => "PERSON_CONFIDENCE_USER_CONFIRMED",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"PERSON_CONFIDENCE_AUTO_MATCHED" => {
::core::option::Option::Some(Self::PERSON_CONFIDENCE_AUTO_MATCHED)
}
"PERSON_CONFIDENCE_USER_CONFIRMED" => {
::core::option::Option::Some(Self::PERSON_CONFIDENCE_USER_CONFIRMED)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::PERSON_CONFIDENCE_AUTO_MATCHED, Self::PERSON_CONFIDENCE_USER_CONFIRMED]
}
}
/// Method used to obtain the body height estimate in BodyPose3DDetection.
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum BodyPose3DHeightEstimation {
BODY_POSE_3D_HEIGHT_ESTIMATION_UNSPECIFIED = 0i32,
BODY_POSE_3D_HEIGHT_ESTIMATION_REFERENCE = 1i32,
BODY_POSE_3D_HEIGHT_ESTIMATION_MEASURED = 2i32,
}
impl BodyPose3DHeightEstimation {
///Idiomatic alias for [`Self::BODY_POSE_3D_HEIGHT_ESTIMATION_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const BodyPose3dHeightEstimationUnspecified: Self = Self::BODY_POSE_3D_HEIGHT_ESTIMATION_UNSPECIFIED;
///Idiomatic alias for [`Self::BODY_POSE_3D_HEIGHT_ESTIMATION_REFERENCE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const BodyPose3dHeightEstimationReference: Self = Self::BODY_POSE_3D_HEIGHT_ESTIMATION_REFERENCE;
///Idiomatic alias for [`Self::BODY_POSE_3D_HEIGHT_ESTIMATION_MEASURED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const BodyPose3dHeightEstimationMeasured: Self = Self::BODY_POSE_3D_HEIGHT_ESTIMATION_MEASURED;
}
impl ::core::default::Default for BodyPose3DHeightEstimation {
fn default() -> Self {
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for BodyPose3DHeightEstimation {
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 BodyPose3DHeightEstimation {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = BodyPose3DHeightEstimation;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(BodyPose3DHeightEstimation)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<BodyPose3DHeightEstimation, E> {
<BodyPose3DHeightEstimation 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<BodyPose3DHeightEstimation, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<BodyPose3DHeightEstimation 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<BodyPose3DHeightEstimation, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<BodyPose3DHeightEstimation 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<BodyPose3DHeightEstimation, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for BodyPose3DHeightEstimation {
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 BodyPose3DHeightEstimation {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => {
::core::option::Option::Some(
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_UNSPECIFIED,
)
}
1i32 => {
::core::option::Option::Some(
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_REFERENCE,
)
}
2i32 => {
::core::option::Option::Some(
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_MEASURED,
)
}
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_UNSPECIFIED => {
"BODY_POSE_3D_HEIGHT_ESTIMATION_UNSPECIFIED"
}
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_REFERENCE => {
"BODY_POSE_3D_HEIGHT_ESTIMATION_REFERENCE"
}
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_MEASURED => {
"BODY_POSE_3D_HEIGHT_ESTIMATION_MEASURED"
}
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"BODY_POSE_3D_HEIGHT_ESTIMATION_UNSPECIFIED" => {
::core::option::Option::Some(
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_UNSPECIFIED,
)
}
"BODY_POSE_3D_HEIGHT_ESTIMATION_REFERENCE" => {
::core::option::Option::Some(
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_REFERENCE,
)
}
"BODY_POSE_3D_HEIGHT_ESTIMATION_MEASURED" => {
::core::option::Option::Some(
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_MEASURED,
)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_UNSPECIFIED,
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_REFERENCE,
Self::BODY_POSE_3D_HEIGHT_ESTIMATION_MEASURED,
]
}
}
/// Chirality (handedness) of a detected hand.
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum HandChirality {
HAND_CHIRALITY_UNSPECIFIED = 0i32,
HAND_CHIRALITY_LEFT = 1i32,
HAND_CHIRALITY_RIGHT = 2i32,
}
impl HandChirality {
///Idiomatic alias for [`Self::HAND_CHIRALITY_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::HAND_CHIRALITY_UNSPECIFIED;
///Idiomatic alias for [`Self::HAND_CHIRALITY_LEFT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Left: Self = Self::HAND_CHIRALITY_LEFT;
///Idiomatic alias for [`Self::HAND_CHIRALITY_RIGHT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Right: Self = Self::HAND_CHIRALITY_RIGHT;
}
impl ::core::default::Default for HandChirality {
fn default() -> Self {
Self::HAND_CHIRALITY_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for HandChirality {
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 HandChirality {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = HandChirality;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(HandChirality)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<HandChirality, E> {
<HandChirality 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<HandChirality, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<HandChirality 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<HandChirality, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<HandChirality 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<HandChirality, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for HandChirality {
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 HandChirality {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::HAND_CHIRALITY_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::HAND_CHIRALITY_LEFT),
2i32 => ::core::option::Option::Some(Self::HAND_CHIRALITY_RIGHT),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::HAND_CHIRALITY_UNSPECIFIED => "HAND_CHIRALITY_UNSPECIFIED",
Self::HAND_CHIRALITY_LEFT => "HAND_CHIRALITY_LEFT",
Self::HAND_CHIRALITY_RIGHT => "HAND_CHIRALITY_RIGHT",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"HAND_CHIRALITY_UNSPECIFIED" => {
::core::option::Option::Some(Self::HAND_CHIRALITY_UNSPECIFIED)
}
"HAND_CHIRALITY_LEFT" => {
::core::option::Option::Some(Self::HAND_CHIRALITY_LEFT)
}
"HAND_CHIRALITY_RIGHT" => {
::core::option::Option::Some(Self::HAND_CHIRALITY_RIGHT)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::HAND_CHIRALITY_UNSPECIFIED,
Self::HAND_CHIRALITY_LEFT,
Self::HAND_CHIRALITY_RIGHT,
]
}
}
/// Source of timing information for a media track.
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum TrackTimeSource {
TRACK_TIME_SOURCE_UNSPECIFIED = 0i32,
TRACK_TIME_SOURCE_DECLARED = 1i32,
TRACK_TIME_SOURCE_PACKET_OBSERVED = 2i32,
TRACK_TIME_SOURCE_DECODED_OBSERVED = 3i32,
}
impl TrackTimeSource {
///Idiomatic alias for [`Self::TRACK_TIME_SOURCE_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::TRACK_TIME_SOURCE_UNSPECIFIED;
///Idiomatic alias for [`Self::TRACK_TIME_SOURCE_DECLARED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Declared: Self = Self::TRACK_TIME_SOURCE_DECLARED;
///Idiomatic alias for [`Self::TRACK_TIME_SOURCE_PACKET_OBSERVED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const PacketObserved: Self = Self::TRACK_TIME_SOURCE_PACKET_OBSERVED;
///Idiomatic alias for [`Self::TRACK_TIME_SOURCE_DECODED_OBSERVED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const DecodedObserved: Self = Self::TRACK_TIME_SOURCE_DECODED_OBSERVED;
}
impl ::core::default::Default for TrackTimeSource {
fn default() -> Self {
Self::TRACK_TIME_SOURCE_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for TrackTimeSource {
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 TrackTimeSource {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = TrackTimeSource;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(TrackTimeSource)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<TrackTimeSource, E> {
<TrackTimeSource 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<TrackTimeSource, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<TrackTimeSource 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<TrackTimeSource, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<TrackTimeSource 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<TrackTimeSource, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for TrackTimeSource {
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 TrackTimeSource {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::TRACK_TIME_SOURCE_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::TRACK_TIME_SOURCE_DECLARED),
2i32 => ::core::option::Option::Some(Self::TRACK_TIME_SOURCE_PACKET_OBSERVED),
3i32 => {
::core::option::Option::Some(Self::TRACK_TIME_SOURCE_DECODED_OBSERVED)
}
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::TRACK_TIME_SOURCE_UNSPECIFIED => "TRACK_TIME_SOURCE_UNSPECIFIED",
Self::TRACK_TIME_SOURCE_DECLARED => "TRACK_TIME_SOURCE_DECLARED",
Self::TRACK_TIME_SOURCE_PACKET_OBSERVED => {
"TRACK_TIME_SOURCE_PACKET_OBSERVED"
}
Self::TRACK_TIME_SOURCE_DECODED_OBSERVED => {
"TRACK_TIME_SOURCE_DECODED_OBSERVED"
}
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"TRACK_TIME_SOURCE_UNSPECIFIED" => {
::core::option::Option::Some(Self::TRACK_TIME_SOURCE_UNSPECIFIED)
}
"TRACK_TIME_SOURCE_DECLARED" => {
::core::option::Option::Some(Self::TRACK_TIME_SOURCE_DECLARED)
}
"TRACK_TIME_SOURCE_PACKET_OBSERVED" => {
::core::option::Option::Some(Self::TRACK_TIME_SOURCE_PACKET_OBSERVED)
}
"TRACK_TIME_SOURCE_DECODED_OBSERVED" => {
::core::option::Option::Some(Self::TRACK_TIME_SOURCE_DECODED_OBSERVED)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::TRACK_TIME_SOURCE_UNSPECIFIED,
Self::TRACK_TIME_SOURCE_DECLARED,
Self::TRACK_TIME_SOURCE_PACKET_OBSERVED,
Self::TRACK_TIME_SOURCE_DECODED_OBSERVED,
]
}
}
/// ── Batch 1: DB-owned enums (§6.3) ──────────────────────────────────────────
///
/// Database asset tri-state. Renamed `DbMediaKind` (distinct from SP1's `MediaKind` oneof; same package since mono-consolidation).
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum DbMediaKind {
/// src `Unknown`
MEDIA_KIND_UNSPECIFIED = 0i32,
MEDIA_KIND_VIDEO = 1i32,
MEDIA_KIND_AUDIO = 2i32,
}
impl DbMediaKind {
///Idiomatic alias for [`Self::MEDIA_KIND_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const MediaKindUnspecified: Self = Self::MEDIA_KIND_UNSPECIFIED;
///Idiomatic alias for [`Self::MEDIA_KIND_VIDEO`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const MediaKindVideo: Self = Self::MEDIA_KIND_VIDEO;
///Idiomatic alias for [`Self::MEDIA_KIND_AUDIO`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const MediaKindAudio: Self = Self::MEDIA_KIND_AUDIO;
}
impl ::core::default::Default for DbMediaKind {
fn default() -> Self {
Self::MEDIA_KIND_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for DbMediaKind {
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 DbMediaKind {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = DbMediaKind;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(DbMediaKind)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<DbMediaKind, E> {
<DbMediaKind 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<DbMediaKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<DbMediaKind 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<DbMediaKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<DbMediaKind 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<DbMediaKind, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for DbMediaKind {
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 DbMediaKind {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::MEDIA_KIND_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::MEDIA_KIND_VIDEO),
2i32 => ::core::option::Option::Some(Self::MEDIA_KIND_AUDIO),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::MEDIA_KIND_UNSPECIFIED => "MEDIA_KIND_UNSPECIFIED",
Self::MEDIA_KIND_VIDEO => "MEDIA_KIND_VIDEO",
Self::MEDIA_KIND_AUDIO => "MEDIA_KIND_AUDIO",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"MEDIA_KIND_UNSPECIFIED" => {
::core::option::Option::Some(Self::MEDIA_KIND_UNSPECIFIED)
}
"MEDIA_KIND_VIDEO" => ::core::option::Option::Some(Self::MEDIA_KIND_VIDEO),
"MEDIA_KIND_AUDIO" => ::core::option::Option::Some(Self::MEDIA_KIND_AUDIO),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::MEDIA_KIND_UNSPECIFIED, Self::MEDIA_KIND_VIDEO, Self::MEDIA_KIND_AUDIO]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum SubtitleTrackFormat {
/// src `Unknown`
SUBTITLE_TRACK_FORMAT_UNSPECIFIED = 0i32,
SUBTITLE_TRACK_FORMAT_TEXT = 1i32,
SUBTITLE_TRACK_FORMAT_ASS = 2i32,
SUBTITLE_TRACK_FORMAT_BITMAP = 3i32,
SUBTITLE_TRACK_FORMAT_SRT = 4i32,
SUBTITLE_TRACK_FORMAT_VTT = 5i32,
SUBTITLE_TRACK_FORMAT_TTML = 6i32,
SUBTITLE_TRACK_FORMAT_SAMI = 7i32,
SUBTITLE_TRACK_FORMAT_LRC = 8i32,
SUBTITLE_TRACK_FORMAT_WHISPER = 9i32,
}
impl SubtitleTrackFormat {
///Idiomatic alias for [`Self::SUBTITLE_TRACK_FORMAT_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::SUBTITLE_TRACK_FORMAT_UNSPECIFIED;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_FORMAT_TEXT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Text: Self = Self::SUBTITLE_TRACK_FORMAT_TEXT;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_FORMAT_ASS`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ass: Self = Self::SUBTITLE_TRACK_FORMAT_ASS;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_FORMAT_BITMAP`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Bitmap: Self = Self::SUBTITLE_TRACK_FORMAT_BITMAP;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_FORMAT_SRT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Srt: Self = Self::SUBTITLE_TRACK_FORMAT_SRT;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_FORMAT_VTT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Vtt: Self = Self::SUBTITLE_TRACK_FORMAT_VTT;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_FORMAT_TTML`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ttml: Self = Self::SUBTITLE_TRACK_FORMAT_TTML;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_FORMAT_SAMI`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Sami: Self = Self::SUBTITLE_TRACK_FORMAT_SAMI;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_FORMAT_LRC`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Lrc: Self = Self::SUBTITLE_TRACK_FORMAT_LRC;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_FORMAT_WHISPER`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Whisper: Self = Self::SUBTITLE_TRACK_FORMAT_WHISPER;
}
impl ::core::default::Default for SubtitleTrackFormat {
fn default() -> Self {
Self::SUBTITLE_TRACK_FORMAT_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for SubtitleTrackFormat {
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 SubtitleTrackFormat {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = SubtitleTrackFormat;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(SubtitleTrackFormat)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<SubtitleTrackFormat, E> {
<SubtitleTrackFormat 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<SubtitleTrackFormat, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<SubtitleTrackFormat 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<SubtitleTrackFormat, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<SubtitleTrackFormat 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<SubtitleTrackFormat, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for SubtitleTrackFormat {
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 SubtitleTrackFormat {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_TEXT),
2i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_ASS),
3i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_BITMAP),
4i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_SRT),
5i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_VTT),
6i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_TTML),
7i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_SAMI),
8i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_LRC),
9i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_WHISPER),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::SUBTITLE_TRACK_FORMAT_UNSPECIFIED => {
"SUBTITLE_TRACK_FORMAT_UNSPECIFIED"
}
Self::SUBTITLE_TRACK_FORMAT_TEXT => "SUBTITLE_TRACK_FORMAT_TEXT",
Self::SUBTITLE_TRACK_FORMAT_ASS => "SUBTITLE_TRACK_FORMAT_ASS",
Self::SUBTITLE_TRACK_FORMAT_BITMAP => "SUBTITLE_TRACK_FORMAT_BITMAP",
Self::SUBTITLE_TRACK_FORMAT_SRT => "SUBTITLE_TRACK_FORMAT_SRT",
Self::SUBTITLE_TRACK_FORMAT_VTT => "SUBTITLE_TRACK_FORMAT_VTT",
Self::SUBTITLE_TRACK_FORMAT_TTML => "SUBTITLE_TRACK_FORMAT_TTML",
Self::SUBTITLE_TRACK_FORMAT_SAMI => "SUBTITLE_TRACK_FORMAT_SAMI",
Self::SUBTITLE_TRACK_FORMAT_LRC => "SUBTITLE_TRACK_FORMAT_LRC",
Self::SUBTITLE_TRACK_FORMAT_WHISPER => "SUBTITLE_TRACK_FORMAT_WHISPER",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"SUBTITLE_TRACK_FORMAT_UNSPECIFIED" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_UNSPECIFIED)
}
"SUBTITLE_TRACK_FORMAT_TEXT" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_TEXT)
}
"SUBTITLE_TRACK_FORMAT_ASS" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_ASS)
}
"SUBTITLE_TRACK_FORMAT_BITMAP" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_BITMAP)
}
"SUBTITLE_TRACK_FORMAT_SRT" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_SRT)
}
"SUBTITLE_TRACK_FORMAT_VTT" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_VTT)
}
"SUBTITLE_TRACK_FORMAT_TTML" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_TTML)
}
"SUBTITLE_TRACK_FORMAT_SAMI" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_SAMI)
}
"SUBTITLE_TRACK_FORMAT_LRC" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_LRC)
}
"SUBTITLE_TRACK_FORMAT_WHISPER" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_FORMAT_WHISPER)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::SUBTITLE_TRACK_FORMAT_UNSPECIFIED,
Self::SUBTITLE_TRACK_FORMAT_TEXT,
Self::SUBTITLE_TRACK_FORMAT_ASS,
Self::SUBTITLE_TRACK_FORMAT_BITMAP,
Self::SUBTITLE_TRACK_FORMAT_SRT,
Self::SUBTITLE_TRACK_FORMAT_VTT,
Self::SUBTITLE_TRACK_FORMAT_TTML,
Self::SUBTITLE_TRACK_FORMAT_SAMI,
Self::SUBTITLE_TRACK_FORMAT_LRC,
Self::SUBTITLE_TRACK_FORMAT_WHISPER,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum SubtitleTrackRole {
/// src `Unknown`
SUBTITLE_TRACK_ROLE_UNSPECIFIED = 0i32,
SUBTITLE_TRACK_ROLE_SUBTITLE = 1i32,
SUBTITLE_TRACK_ROLE_CAPTION = 2i32,
SUBTITLE_TRACK_ROLE_TRANSCRIPT = 3i32,
SUBTITLE_TRACK_ROLE_TRANSLATION = 4i32,
SUBTITLE_TRACK_ROLE_LYRICS = 5i32,
SUBTITLE_TRACK_ROLE_COMMENTARY = 6i32,
}
impl SubtitleTrackRole {
///Idiomatic alias for [`Self::SUBTITLE_TRACK_ROLE_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::SUBTITLE_TRACK_ROLE_UNSPECIFIED;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_ROLE_SUBTITLE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Subtitle: Self = Self::SUBTITLE_TRACK_ROLE_SUBTITLE;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_ROLE_CAPTION`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Caption: Self = Self::SUBTITLE_TRACK_ROLE_CAPTION;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_ROLE_TRANSCRIPT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Transcript: Self = Self::SUBTITLE_TRACK_ROLE_TRANSCRIPT;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_ROLE_TRANSLATION`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Translation: Self = Self::SUBTITLE_TRACK_ROLE_TRANSLATION;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_ROLE_LYRICS`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Lyrics: Self = Self::SUBTITLE_TRACK_ROLE_LYRICS;
///Idiomatic alias for [`Self::SUBTITLE_TRACK_ROLE_COMMENTARY`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Commentary: Self = Self::SUBTITLE_TRACK_ROLE_COMMENTARY;
}
impl ::core::default::Default for SubtitleTrackRole {
fn default() -> Self {
Self::SUBTITLE_TRACK_ROLE_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for SubtitleTrackRole {
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 SubtitleTrackRole {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = SubtitleTrackRole;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(SubtitleTrackRole)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<SubtitleTrackRole, E> {
<SubtitleTrackRole 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<SubtitleTrackRole, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<SubtitleTrackRole 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<SubtitleTrackRole, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<SubtitleTrackRole 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<SubtitleTrackRole, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for SubtitleTrackRole {
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 SubtitleTrackRole {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_SUBTITLE),
2i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_CAPTION),
3i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_TRANSCRIPT),
4i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_TRANSLATION),
5i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_LYRICS),
6i32 => ::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_COMMENTARY),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::SUBTITLE_TRACK_ROLE_UNSPECIFIED => "SUBTITLE_TRACK_ROLE_UNSPECIFIED",
Self::SUBTITLE_TRACK_ROLE_SUBTITLE => "SUBTITLE_TRACK_ROLE_SUBTITLE",
Self::SUBTITLE_TRACK_ROLE_CAPTION => "SUBTITLE_TRACK_ROLE_CAPTION",
Self::SUBTITLE_TRACK_ROLE_TRANSCRIPT => "SUBTITLE_TRACK_ROLE_TRANSCRIPT",
Self::SUBTITLE_TRACK_ROLE_TRANSLATION => "SUBTITLE_TRACK_ROLE_TRANSLATION",
Self::SUBTITLE_TRACK_ROLE_LYRICS => "SUBTITLE_TRACK_ROLE_LYRICS",
Self::SUBTITLE_TRACK_ROLE_COMMENTARY => "SUBTITLE_TRACK_ROLE_COMMENTARY",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"SUBTITLE_TRACK_ROLE_UNSPECIFIED" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_UNSPECIFIED)
}
"SUBTITLE_TRACK_ROLE_SUBTITLE" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_SUBTITLE)
}
"SUBTITLE_TRACK_ROLE_CAPTION" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_CAPTION)
}
"SUBTITLE_TRACK_ROLE_TRANSCRIPT" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_TRANSCRIPT)
}
"SUBTITLE_TRACK_ROLE_TRANSLATION" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_TRANSLATION)
}
"SUBTITLE_TRACK_ROLE_LYRICS" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_LYRICS)
}
"SUBTITLE_TRACK_ROLE_COMMENTARY" => {
::core::option::Option::Some(Self::SUBTITLE_TRACK_ROLE_COMMENTARY)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::SUBTITLE_TRACK_ROLE_UNSPECIFIED,
Self::SUBTITLE_TRACK_ROLE_SUBTITLE,
Self::SUBTITLE_TRACK_ROLE_CAPTION,
Self::SUBTITLE_TRACK_ROLE_TRANSCRIPT,
Self::SUBTITLE_TRACK_ROLE_TRANSLATION,
Self::SUBTITLE_TRACK_ROLE_LYRICS,
Self::SUBTITLE_TRACK_ROLE_COMMENTARY,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum ChannelLayoutKind {
/// src `Unknown`
CHANNEL_LAYOUT_KIND_UNSPECIFIED = 0i32,
CHANNEL_LAYOUT_KIND_MONO = 1i32,
CHANNEL_LAYOUT_KIND_STEREO = 2i32,
CHANNEL_LAYOUT_KIND_STEREO_DOWNMIX = 3i32,
CHANNEL_LAYOUT_KIND_SURROUND = 4i32,
CHANNEL_LAYOUT_KIND_QUAD = 5i32,
CHANNEL_LAYOUT_KIND_HEXAGONAL = 6i32,
CHANNEL_LAYOUT_KIND_OCTAGONAL = 7i32,
CHANNEL_LAYOUT_KIND_HEXADECAGONAL = 8i32,
CHANNEL_LAYOUT_KIND_CUBE = 9i32,
CHANNEL_LAYOUT_KIND_CH2_1 = 10i32,
CHANNEL_LAYOUT_KIND_CH2_1_ALT = 11i32,
CHANNEL_LAYOUT_KIND_CH2_2 = 12i32,
CHANNEL_LAYOUT_KIND_CH3_1 = 13i32,
CHANNEL_LAYOUT_KIND_CH3_1_2 = 14i32,
CHANNEL_LAYOUT_KIND_CH4_0 = 15i32,
CHANNEL_LAYOUT_KIND_CH4_1 = 16i32,
CHANNEL_LAYOUT_KIND_CH5_0 = 17i32,
CHANNEL_LAYOUT_KIND_CH5_0_BACK = 18i32,
CHANNEL_LAYOUT_KIND_CH5_1 = 19i32,
CHANNEL_LAYOUT_KIND_CH5_1_BACK = 20i32,
CHANNEL_LAYOUT_KIND_CH5_1_2_BACK = 21i32,
CHANNEL_LAYOUT_KIND_CH5_1_4_BACK = 22i32,
CHANNEL_LAYOUT_KIND_CH6_0 = 23i32,
CHANNEL_LAYOUT_KIND_CH6_0_FRONT = 24i32,
CHANNEL_LAYOUT_KIND_CH6_1 = 25i32,
CHANNEL_LAYOUT_KIND_CH6_1_BACK = 26i32,
CHANNEL_LAYOUT_KIND_CH6_1_FRONT = 27i32,
CHANNEL_LAYOUT_KIND_CH7_0 = 28i32,
CHANNEL_LAYOUT_KIND_CH7_0_FRONT = 29i32,
CHANNEL_LAYOUT_KIND_CH7_1 = 30i32,
CHANNEL_LAYOUT_KIND_CH7_1_WIDE = 31i32,
CHANNEL_LAYOUT_KIND_CH7_1_WIDE_BACK = 32i32,
CHANNEL_LAYOUT_KIND_CH7_1_TOP_BACK = 33i32,
CHANNEL_LAYOUT_KIND_CH7_1_2 = 34i32,
CHANNEL_LAYOUT_KIND_CH7_1_4_BACK = 35i32,
CHANNEL_LAYOUT_KIND_CH7_2_3 = 36i32,
CHANNEL_LAYOUT_KIND_CH9_1_4_BACK = 37i32,
CHANNEL_LAYOUT_KIND_CH22_2 = 38i32,
}
impl ChannelLayoutKind {
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::CHANNEL_LAYOUT_KIND_UNSPECIFIED;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_MONO`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mono: Self = Self::CHANNEL_LAYOUT_KIND_MONO;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_STEREO`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Stereo: Self = Self::CHANNEL_LAYOUT_KIND_STEREO;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_STEREO_DOWNMIX`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const StereoDownmix: Self = Self::CHANNEL_LAYOUT_KIND_STEREO_DOWNMIX;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_SURROUND`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Surround: Self = Self::CHANNEL_LAYOUT_KIND_SURROUND;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_QUAD`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Quad: Self = Self::CHANNEL_LAYOUT_KIND_QUAD;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_HEXAGONAL`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Hexagonal: Self = Self::CHANNEL_LAYOUT_KIND_HEXAGONAL;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_OCTAGONAL`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Octagonal: Self = Self::CHANNEL_LAYOUT_KIND_OCTAGONAL;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_HEXADECAGONAL`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Hexadecagonal: Self = Self::CHANNEL_LAYOUT_KIND_HEXADECAGONAL;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CUBE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Cube: Self = Self::CHANNEL_LAYOUT_KIND_CUBE;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH2_1`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch21: Self = Self::CHANNEL_LAYOUT_KIND_CH2_1;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH2_1_ALT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch21Alt: Self = Self::CHANNEL_LAYOUT_KIND_CH2_1_ALT;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH2_2`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch22: Self = Self::CHANNEL_LAYOUT_KIND_CH2_2;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH3_1`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch31: Self = Self::CHANNEL_LAYOUT_KIND_CH3_1;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH3_1_2`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch312: Self = Self::CHANNEL_LAYOUT_KIND_CH3_1_2;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH4_0`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch40: Self = Self::CHANNEL_LAYOUT_KIND_CH4_0;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH4_1`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch41: Self = Self::CHANNEL_LAYOUT_KIND_CH4_1;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH5_0`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch50: Self = Self::CHANNEL_LAYOUT_KIND_CH5_0;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH5_0_BACK`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch50Back: Self = Self::CHANNEL_LAYOUT_KIND_CH5_0_BACK;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH5_1`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch51: Self = Self::CHANNEL_LAYOUT_KIND_CH5_1;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH5_1_BACK`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch51Back: Self = Self::CHANNEL_LAYOUT_KIND_CH5_1_BACK;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH5_1_2_BACK`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch512Back: Self = Self::CHANNEL_LAYOUT_KIND_CH5_1_2_BACK;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH5_1_4_BACK`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch514Back: Self = Self::CHANNEL_LAYOUT_KIND_CH5_1_4_BACK;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH6_0`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch60: Self = Self::CHANNEL_LAYOUT_KIND_CH6_0;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH6_0_FRONT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch60Front: Self = Self::CHANNEL_LAYOUT_KIND_CH6_0_FRONT;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH6_1`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch61: Self = Self::CHANNEL_LAYOUT_KIND_CH6_1;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH6_1_BACK`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch61Back: Self = Self::CHANNEL_LAYOUT_KIND_CH6_1_BACK;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH6_1_FRONT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch61Front: Self = Self::CHANNEL_LAYOUT_KIND_CH6_1_FRONT;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH7_0`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch70: Self = Self::CHANNEL_LAYOUT_KIND_CH7_0;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH7_0_FRONT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch70Front: Self = Self::CHANNEL_LAYOUT_KIND_CH7_0_FRONT;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH7_1`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch71: Self = Self::CHANNEL_LAYOUT_KIND_CH7_1;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch71Wide: Self = Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE_BACK`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch71WideBack: Self = Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE_BACK;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH7_1_TOP_BACK`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch71TopBack: Self = Self::CHANNEL_LAYOUT_KIND_CH7_1_TOP_BACK;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH7_1_2`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch712: Self = Self::CHANNEL_LAYOUT_KIND_CH7_1_2;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH7_1_4_BACK`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch714Back: Self = Self::CHANNEL_LAYOUT_KIND_CH7_1_4_BACK;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH7_2_3`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch723: Self = Self::CHANNEL_LAYOUT_KIND_CH7_2_3;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH9_1_4_BACK`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch914Back: Self = Self::CHANNEL_LAYOUT_KIND_CH9_1_4_BACK;
///Idiomatic alias for [`Self::CHANNEL_LAYOUT_KIND_CH22_2`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ch222: Self = Self::CHANNEL_LAYOUT_KIND_CH22_2;
}
impl ::core::default::Default for ChannelLayoutKind {
fn default() -> Self {
Self::CHANNEL_LAYOUT_KIND_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for ChannelLayoutKind {
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 ChannelLayoutKind {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = ChannelLayoutKind;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(ChannelLayoutKind)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<ChannelLayoutKind, E> {
<ChannelLayoutKind 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<ChannelLayoutKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<ChannelLayoutKind 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<ChannelLayoutKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<ChannelLayoutKind 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<ChannelLayoutKind, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for ChannelLayoutKind {
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 ChannelLayoutKind {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_MONO),
2i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_STEREO),
3i32 => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_STEREO_DOWNMIX)
}
4i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_SURROUND),
5i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_QUAD),
6i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_HEXAGONAL),
7i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_OCTAGONAL),
8i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_HEXADECAGONAL),
9i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CUBE),
10i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH2_1),
11i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH2_1_ALT),
12i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH2_2),
13i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH3_1),
14i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH3_1_2),
15i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH4_0),
16i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH4_1),
17i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_0),
18i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_0_BACK),
19i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_1),
20i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_1_BACK),
21i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_1_2_BACK),
22i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_1_4_BACK),
23i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH6_0),
24i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH6_0_FRONT),
25i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH6_1),
26i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH6_1_BACK),
27i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH6_1_FRONT),
28i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_0),
29i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_0_FRONT),
30i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1),
31i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE),
32i32 => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE_BACK)
}
33i32 => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1_TOP_BACK)
}
34i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1_2),
35i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1_4_BACK),
36i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_2_3),
37i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH9_1_4_BACK),
38i32 => ::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH22_2),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::CHANNEL_LAYOUT_KIND_UNSPECIFIED => "CHANNEL_LAYOUT_KIND_UNSPECIFIED",
Self::CHANNEL_LAYOUT_KIND_MONO => "CHANNEL_LAYOUT_KIND_MONO",
Self::CHANNEL_LAYOUT_KIND_STEREO => "CHANNEL_LAYOUT_KIND_STEREO",
Self::CHANNEL_LAYOUT_KIND_STEREO_DOWNMIX => {
"CHANNEL_LAYOUT_KIND_STEREO_DOWNMIX"
}
Self::CHANNEL_LAYOUT_KIND_SURROUND => "CHANNEL_LAYOUT_KIND_SURROUND",
Self::CHANNEL_LAYOUT_KIND_QUAD => "CHANNEL_LAYOUT_KIND_QUAD",
Self::CHANNEL_LAYOUT_KIND_HEXAGONAL => "CHANNEL_LAYOUT_KIND_HEXAGONAL",
Self::CHANNEL_LAYOUT_KIND_OCTAGONAL => "CHANNEL_LAYOUT_KIND_OCTAGONAL",
Self::CHANNEL_LAYOUT_KIND_HEXADECAGONAL => {
"CHANNEL_LAYOUT_KIND_HEXADECAGONAL"
}
Self::CHANNEL_LAYOUT_KIND_CUBE => "CHANNEL_LAYOUT_KIND_CUBE",
Self::CHANNEL_LAYOUT_KIND_CH2_1 => "CHANNEL_LAYOUT_KIND_CH2_1",
Self::CHANNEL_LAYOUT_KIND_CH2_1_ALT => "CHANNEL_LAYOUT_KIND_CH2_1_ALT",
Self::CHANNEL_LAYOUT_KIND_CH2_2 => "CHANNEL_LAYOUT_KIND_CH2_2",
Self::CHANNEL_LAYOUT_KIND_CH3_1 => "CHANNEL_LAYOUT_KIND_CH3_1",
Self::CHANNEL_LAYOUT_KIND_CH3_1_2 => "CHANNEL_LAYOUT_KIND_CH3_1_2",
Self::CHANNEL_LAYOUT_KIND_CH4_0 => "CHANNEL_LAYOUT_KIND_CH4_0",
Self::CHANNEL_LAYOUT_KIND_CH4_1 => "CHANNEL_LAYOUT_KIND_CH4_1",
Self::CHANNEL_LAYOUT_KIND_CH5_0 => "CHANNEL_LAYOUT_KIND_CH5_0",
Self::CHANNEL_LAYOUT_KIND_CH5_0_BACK => "CHANNEL_LAYOUT_KIND_CH5_0_BACK",
Self::CHANNEL_LAYOUT_KIND_CH5_1 => "CHANNEL_LAYOUT_KIND_CH5_1",
Self::CHANNEL_LAYOUT_KIND_CH5_1_BACK => "CHANNEL_LAYOUT_KIND_CH5_1_BACK",
Self::CHANNEL_LAYOUT_KIND_CH5_1_2_BACK => "CHANNEL_LAYOUT_KIND_CH5_1_2_BACK",
Self::CHANNEL_LAYOUT_KIND_CH5_1_4_BACK => "CHANNEL_LAYOUT_KIND_CH5_1_4_BACK",
Self::CHANNEL_LAYOUT_KIND_CH6_0 => "CHANNEL_LAYOUT_KIND_CH6_0",
Self::CHANNEL_LAYOUT_KIND_CH6_0_FRONT => "CHANNEL_LAYOUT_KIND_CH6_0_FRONT",
Self::CHANNEL_LAYOUT_KIND_CH6_1 => "CHANNEL_LAYOUT_KIND_CH6_1",
Self::CHANNEL_LAYOUT_KIND_CH6_1_BACK => "CHANNEL_LAYOUT_KIND_CH6_1_BACK",
Self::CHANNEL_LAYOUT_KIND_CH6_1_FRONT => "CHANNEL_LAYOUT_KIND_CH6_1_FRONT",
Self::CHANNEL_LAYOUT_KIND_CH7_0 => "CHANNEL_LAYOUT_KIND_CH7_0",
Self::CHANNEL_LAYOUT_KIND_CH7_0_FRONT => "CHANNEL_LAYOUT_KIND_CH7_0_FRONT",
Self::CHANNEL_LAYOUT_KIND_CH7_1 => "CHANNEL_LAYOUT_KIND_CH7_1",
Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE => "CHANNEL_LAYOUT_KIND_CH7_1_WIDE",
Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE_BACK => {
"CHANNEL_LAYOUT_KIND_CH7_1_WIDE_BACK"
}
Self::CHANNEL_LAYOUT_KIND_CH7_1_TOP_BACK => {
"CHANNEL_LAYOUT_KIND_CH7_1_TOP_BACK"
}
Self::CHANNEL_LAYOUT_KIND_CH7_1_2 => "CHANNEL_LAYOUT_KIND_CH7_1_2",
Self::CHANNEL_LAYOUT_KIND_CH7_1_4_BACK => "CHANNEL_LAYOUT_KIND_CH7_1_4_BACK",
Self::CHANNEL_LAYOUT_KIND_CH7_2_3 => "CHANNEL_LAYOUT_KIND_CH7_2_3",
Self::CHANNEL_LAYOUT_KIND_CH9_1_4_BACK => "CHANNEL_LAYOUT_KIND_CH9_1_4_BACK",
Self::CHANNEL_LAYOUT_KIND_CH22_2 => "CHANNEL_LAYOUT_KIND_CH22_2",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"CHANNEL_LAYOUT_KIND_UNSPECIFIED" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_UNSPECIFIED)
}
"CHANNEL_LAYOUT_KIND_MONO" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_MONO)
}
"CHANNEL_LAYOUT_KIND_STEREO" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_STEREO)
}
"CHANNEL_LAYOUT_KIND_STEREO_DOWNMIX" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_STEREO_DOWNMIX)
}
"CHANNEL_LAYOUT_KIND_SURROUND" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_SURROUND)
}
"CHANNEL_LAYOUT_KIND_QUAD" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_QUAD)
}
"CHANNEL_LAYOUT_KIND_HEXAGONAL" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_HEXAGONAL)
}
"CHANNEL_LAYOUT_KIND_OCTAGONAL" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_OCTAGONAL)
}
"CHANNEL_LAYOUT_KIND_HEXADECAGONAL" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_HEXADECAGONAL)
}
"CHANNEL_LAYOUT_KIND_CUBE" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CUBE)
}
"CHANNEL_LAYOUT_KIND_CH2_1" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH2_1)
}
"CHANNEL_LAYOUT_KIND_CH2_1_ALT" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH2_1_ALT)
}
"CHANNEL_LAYOUT_KIND_CH2_2" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH2_2)
}
"CHANNEL_LAYOUT_KIND_CH3_1" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH3_1)
}
"CHANNEL_LAYOUT_KIND_CH3_1_2" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH3_1_2)
}
"CHANNEL_LAYOUT_KIND_CH4_0" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH4_0)
}
"CHANNEL_LAYOUT_KIND_CH4_1" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH4_1)
}
"CHANNEL_LAYOUT_KIND_CH5_0" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_0)
}
"CHANNEL_LAYOUT_KIND_CH5_0_BACK" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_0_BACK)
}
"CHANNEL_LAYOUT_KIND_CH5_1" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_1)
}
"CHANNEL_LAYOUT_KIND_CH5_1_BACK" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_1_BACK)
}
"CHANNEL_LAYOUT_KIND_CH5_1_2_BACK" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_1_2_BACK)
}
"CHANNEL_LAYOUT_KIND_CH5_1_4_BACK" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH5_1_4_BACK)
}
"CHANNEL_LAYOUT_KIND_CH6_0" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH6_0)
}
"CHANNEL_LAYOUT_KIND_CH6_0_FRONT" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH6_0_FRONT)
}
"CHANNEL_LAYOUT_KIND_CH6_1" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH6_1)
}
"CHANNEL_LAYOUT_KIND_CH6_1_BACK" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH6_1_BACK)
}
"CHANNEL_LAYOUT_KIND_CH6_1_FRONT" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH6_1_FRONT)
}
"CHANNEL_LAYOUT_KIND_CH7_0" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_0)
}
"CHANNEL_LAYOUT_KIND_CH7_0_FRONT" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_0_FRONT)
}
"CHANNEL_LAYOUT_KIND_CH7_1" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1)
}
"CHANNEL_LAYOUT_KIND_CH7_1_WIDE" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE)
}
"CHANNEL_LAYOUT_KIND_CH7_1_WIDE_BACK" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE_BACK)
}
"CHANNEL_LAYOUT_KIND_CH7_1_TOP_BACK" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1_TOP_BACK)
}
"CHANNEL_LAYOUT_KIND_CH7_1_2" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1_2)
}
"CHANNEL_LAYOUT_KIND_CH7_1_4_BACK" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_1_4_BACK)
}
"CHANNEL_LAYOUT_KIND_CH7_2_3" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH7_2_3)
}
"CHANNEL_LAYOUT_KIND_CH9_1_4_BACK" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH9_1_4_BACK)
}
"CHANNEL_LAYOUT_KIND_CH22_2" => {
::core::option::Option::Some(Self::CHANNEL_LAYOUT_KIND_CH22_2)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::CHANNEL_LAYOUT_KIND_UNSPECIFIED,
Self::CHANNEL_LAYOUT_KIND_MONO,
Self::CHANNEL_LAYOUT_KIND_STEREO,
Self::CHANNEL_LAYOUT_KIND_STEREO_DOWNMIX,
Self::CHANNEL_LAYOUT_KIND_SURROUND,
Self::CHANNEL_LAYOUT_KIND_QUAD,
Self::CHANNEL_LAYOUT_KIND_HEXAGONAL,
Self::CHANNEL_LAYOUT_KIND_OCTAGONAL,
Self::CHANNEL_LAYOUT_KIND_HEXADECAGONAL,
Self::CHANNEL_LAYOUT_KIND_CUBE,
Self::CHANNEL_LAYOUT_KIND_CH2_1,
Self::CHANNEL_LAYOUT_KIND_CH2_1_ALT,
Self::CHANNEL_LAYOUT_KIND_CH2_2,
Self::CHANNEL_LAYOUT_KIND_CH3_1,
Self::CHANNEL_LAYOUT_KIND_CH3_1_2,
Self::CHANNEL_LAYOUT_KIND_CH4_0,
Self::CHANNEL_LAYOUT_KIND_CH4_1,
Self::CHANNEL_LAYOUT_KIND_CH5_0,
Self::CHANNEL_LAYOUT_KIND_CH5_0_BACK,
Self::CHANNEL_LAYOUT_KIND_CH5_1,
Self::CHANNEL_LAYOUT_KIND_CH5_1_BACK,
Self::CHANNEL_LAYOUT_KIND_CH5_1_2_BACK,
Self::CHANNEL_LAYOUT_KIND_CH5_1_4_BACK,
Self::CHANNEL_LAYOUT_KIND_CH6_0,
Self::CHANNEL_LAYOUT_KIND_CH6_0_FRONT,
Self::CHANNEL_LAYOUT_KIND_CH6_1,
Self::CHANNEL_LAYOUT_KIND_CH6_1_BACK,
Self::CHANNEL_LAYOUT_KIND_CH6_1_FRONT,
Self::CHANNEL_LAYOUT_KIND_CH7_0,
Self::CHANNEL_LAYOUT_KIND_CH7_0_FRONT,
Self::CHANNEL_LAYOUT_KIND_CH7_1,
Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE,
Self::CHANNEL_LAYOUT_KIND_CH7_1_WIDE_BACK,
Self::CHANNEL_LAYOUT_KIND_CH7_1_TOP_BACK,
Self::CHANNEL_LAYOUT_KIND_CH7_1_2,
Self::CHANNEL_LAYOUT_KIND_CH7_1_4_BACK,
Self::CHANNEL_LAYOUT_KIND_CH7_2_3,
Self::CHANNEL_LAYOUT_KIND_CH9_1_4_BACK,
Self::CHANNEL_LAYOUT_KIND_CH22_2,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum AudioChannelOrderKind {
/// src `Unspecified`
AUDIO_CHANNEL_ORDER_KIND_UNSPECIFIED = 0i32,
AUDIO_CHANNEL_ORDER_KIND_NATIVE = 1i32,
AUDIO_CHANNEL_ORDER_KIND_CUSTOM = 2i32,
AUDIO_CHANNEL_ORDER_KIND_AMBISONIC = 3i32,
}
impl AudioChannelOrderKind {
///Idiomatic alias for [`Self::AUDIO_CHANNEL_ORDER_KIND_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::AUDIO_CHANNEL_ORDER_KIND_UNSPECIFIED;
///Idiomatic alias for [`Self::AUDIO_CHANNEL_ORDER_KIND_NATIVE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Native: Self = Self::AUDIO_CHANNEL_ORDER_KIND_NATIVE;
///Idiomatic alias for [`Self::AUDIO_CHANNEL_ORDER_KIND_CUSTOM`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Custom: Self = Self::AUDIO_CHANNEL_ORDER_KIND_CUSTOM;
///Idiomatic alias for [`Self::AUDIO_CHANNEL_ORDER_KIND_AMBISONIC`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ambisonic: Self = Self::AUDIO_CHANNEL_ORDER_KIND_AMBISONIC;
}
impl ::core::default::Default for AudioChannelOrderKind {
fn default() -> Self {
Self::AUDIO_CHANNEL_ORDER_KIND_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for AudioChannelOrderKind {
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 AudioChannelOrderKind {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = AudioChannelOrderKind;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(AudioChannelOrderKind)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<AudioChannelOrderKind, E> {
<AudioChannelOrderKind 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<AudioChannelOrderKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioChannelOrderKind 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<AudioChannelOrderKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioChannelOrderKind 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<AudioChannelOrderKind, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for AudioChannelOrderKind {
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 AudioChannelOrderKind {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => {
::core::option::Option::Some(Self::AUDIO_CHANNEL_ORDER_KIND_UNSPECIFIED)
}
1i32 => ::core::option::Option::Some(Self::AUDIO_CHANNEL_ORDER_KIND_NATIVE),
2i32 => ::core::option::Option::Some(Self::AUDIO_CHANNEL_ORDER_KIND_CUSTOM),
3i32 => {
::core::option::Option::Some(Self::AUDIO_CHANNEL_ORDER_KIND_AMBISONIC)
}
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::AUDIO_CHANNEL_ORDER_KIND_UNSPECIFIED => {
"AUDIO_CHANNEL_ORDER_KIND_UNSPECIFIED"
}
Self::AUDIO_CHANNEL_ORDER_KIND_NATIVE => "AUDIO_CHANNEL_ORDER_KIND_NATIVE",
Self::AUDIO_CHANNEL_ORDER_KIND_CUSTOM => "AUDIO_CHANNEL_ORDER_KIND_CUSTOM",
Self::AUDIO_CHANNEL_ORDER_KIND_AMBISONIC => {
"AUDIO_CHANNEL_ORDER_KIND_AMBISONIC"
}
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"AUDIO_CHANNEL_ORDER_KIND_UNSPECIFIED" => {
::core::option::Option::Some(Self::AUDIO_CHANNEL_ORDER_KIND_UNSPECIFIED)
}
"AUDIO_CHANNEL_ORDER_KIND_NATIVE" => {
::core::option::Option::Some(Self::AUDIO_CHANNEL_ORDER_KIND_NATIVE)
}
"AUDIO_CHANNEL_ORDER_KIND_CUSTOM" => {
::core::option::Option::Some(Self::AUDIO_CHANNEL_ORDER_KIND_CUSTOM)
}
"AUDIO_CHANNEL_ORDER_KIND_AMBISONIC" => {
::core::option::Option::Some(Self::AUDIO_CHANNEL_ORDER_KIND_AMBISONIC)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::AUDIO_CHANNEL_ORDER_KIND_UNSPECIFIED,
Self::AUDIO_CHANNEL_ORDER_KIND_NATIVE,
Self::AUDIO_CHANNEL_ORDER_KIND_CUSTOM,
Self::AUDIO_CHANNEL_ORDER_KIND_AMBISONIC,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum AudioClipKind {
/// src `Unknown`
AUDIO_CLIP_KIND_UNSPECIFIED = 0i32,
AUDIO_CLIP_KIND_WHOLE_TRACK_SUMMARY = 1i32,
AUDIO_CLIP_KIND_VIDEO_SCENE_ALIGNED = 2i32,
AUDIO_CLIP_KIND_FIXED_WINDOW = 3i32,
AUDIO_CLIP_KIND_EVENT_SPAN = 4i32,
}
impl AudioClipKind {
///Idiomatic alias for [`Self::AUDIO_CLIP_KIND_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::AUDIO_CLIP_KIND_UNSPECIFIED;
///Idiomatic alias for [`Self::AUDIO_CLIP_KIND_WHOLE_TRACK_SUMMARY`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const WholeTrackSummary: Self = Self::AUDIO_CLIP_KIND_WHOLE_TRACK_SUMMARY;
///Idiomatic alias for [`Self::AUDIO_CLIP_KIND_VIDEO_SCENE_ALIGNED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const VideoSceneAligned: Self = Self::AUDIO_CLIP_KIND_VIDEO_SCENE_ALIGNED;
///Idiomatic alias for [`Self::AUDIO_CLIP_KIND_FIXED_WINDOW`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const FixedWindow: Self = Self::AUDIO_CLIP_KIND_FIXED_WINDOW;
///Idiomatic alias for [`Self::AUDIO_CLIP_KIND_EVENT_SPAN`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const EventSpan: Self = Self::AUDIO_CLIP_KIND_EVENT_SPAN;
}
impl ::core::default::Default for AudioClipKind {
fn default() -> Self {
Self::AUDIO_CLIP_KIND_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for AudioClipKind {
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 AudioClipKind {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = AudioClipKind;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(AudioClipKind)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<AudioClipKind, E> {
<AudioClipKind 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<AudioClipKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioClipKind 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<AudioClipKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioClipKind 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<AudioClipKind, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for AudioClipKind {
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 AudioClipKind {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::AUDIO_CLIP_KIND_UNSPECIFIED),
1i32 => {
::core::option::Option::Some(Self::AUDIO_CLIP_KIND_WHOLE_TRACK_SUMMARY)
}
2i32 => {
::core::option::Option::Some(Self::AUDIO_CLIP_KIND_VIDEO_SCENE_ALIGNED)
}
3i32 => ::core::option::Option::Some(Self::AUDIO_CLIP_KIND_FIXED_WINDOW),
4i32 => ::core::option::Option::Some(Self::AUDIO_CLIP_KIND_EVENT_SPAN),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::AUDIO_CLIP_KIND_UNSPECIFIED => "AUDIO_CLIP_KIND_UNSPECIFIED",
Self::AUDIO_CLIP_KIND_WHOLE_TRACK_SUMMARY => {
"AUDIO_CLIP_KIND_WHOLE_TRACK_SUMMARY"
}
Self::AUDIO_CLIP_KIND_VIDEO_SCENE_ALIGNED => {
"AUDIO_CLIP_KIND_VIDEO_SCENE_ALIGNED"
}
Self::AUDIO_CLIP_KIND_FIXED_WINDOW => "AUDIO_CLIP_KIND_FIXED_WINDOW",
Self::AUDIO_CLIP_KIND_EVENT_SPAN => "AUDIO_CLIP_KIND_EVENT_SPAN",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"AUDIO_CLIP_KIND_UNSPECIFIED" => {
::core::option::Option::Some(Self::AUDIO_CLIP_KIND_UNSPECIFIED)
}
"AUDIO_CLIP_KIND_WHOLE_TRACK_SUMMARY" => {
::core::option::Option::Some(Self::AUDIO_CLIP_KIND_WHOLE_TRACK_SUMMARY)
}
"AUDIO_CLIP_KIND_VIDEO_SCENE_ALIGNED" => {
::core::option::Option::Some(Self::AUDIO_CLIP_KIND_VIDEO_SCENE_ALIGNED)
}
"AUDIO_CLIP_KIND_FIXED_WINDOW" => {
::core::option::Option::Some(Self::AUDIO_CLIP_KIND_FIXED_WINDOW)
}
"AUDIO_CLIP_KIND_EVENT_SPAN" => {
::core::option::Option::Some(Self::AUDIO_CLIP_KIND_EVENT_SPAN)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::AUDIO_CLIP_KIND_UNSPECIFIED,
Self::AUDIO_CLIP_KIND_WHOLE_TRACK_SUMMARY,
Self::AUDIO_CLIP_KIND_VIDEO_SCENE_ALIGNED,
Self::AUDIO_CLIP_KIND_FIXED_WINDOW,
Self::AUDIO_CLIP_KIND_EVENT_SPAN,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum AudioPrefilterClass {
/// src `Unknown`
AUDIO_PREFILTER_CLASS_UNSPECIFIED = 0i32,
AUDIO_PREFILTER_CLASS_CONTENT = 1i32,
AUDIO_PREFILTER_CLASS_SILENT = 2i32,
AUDIO_PREFILTER_CLASS_NOISE = 3i32,
}
impl AudioPrefilterClass {
///Idiomatic alias for [`Self::AUDIO_PREFILTER_CLASS_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::AUDIO_PREFILTER_CLASS_UNSPECIFIED;
///Idiomatic alias for [`Self::AUDIO_PREFILTER_CLASS_CONTENT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Content: Self = Self::AUDIO_PREFILTER_CLASS_CONTENT;
///Idiomatic alias for [`Self::AUDIO_PREFILTER_CLASS_SILENT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Silent: Self = Self::AUDIO_PREFILTER_CLASS_SILENT;
///Idiomatic alias for [`Self::AUDIO_PREFILTER_CLASS_NOISE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Noise: Self = Self::AUDIO_PREFILTER_CLASS_NOISE;
}
impl ::core::default::Default for AudioPrefilterClass {
fn default() -> Self {
Self::AUDIO_PREFILTER_CLASS_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for AudioPrefilterClass {
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 AudioPrefilterClass {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = AudioPrefilterClass;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(AudioPrefilterClass)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<AudioPrefilterClass, E> {
<AudioPrefilterClass 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<AudioPrefilterClass, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioPrefilterClass 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<AudioPrefilterClass, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioPrefilterClass 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<AudioPrefilterClass, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for AudioPrefilterClass {
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 AudioPrefilterClass {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::AUDIO_PREFILTER_CLASS_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::AUDIO_PREFILTER_CLASS_CONTENT),
2i32 => ::core::option::Option::Some(Self::AUDIO_PREFILTER_CLASS_SILENT),
3i32 => ::core::option::Option::Some(Self::AUDIO_PREFILTER_CLASS_NOISE),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::AUDIO_PREFILTER_CLASS_UNSPECIFIED => {
"AUDIO_PREFILTER_CLASS_UNSPECIFIED"
}
Self::AUDIO_PREFILTER_CLASS_CONTENT => "AUDIO_PREFILTER_CLASS_CONTENT",
Self::AUDIO_PREFILTER_CLASS_SILENT => "AUDIO_PREFILTER_CLASS_SILENT",
Self::AUDIO_PREFILTER_CLASS_NOISE => "AUDIO_PREFILTER_CLASS_NOISE",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"AUDIO_PREFILTER_CLASS_UNSPECIFIED" => {
::core::option::Option::Some(Self::AUDIO_PREFILTER_CLASS_UNSPECIFIED)
}
"AUDIO_PREFILTER_CLASS_CONTENT" => {
::core::option::Option::Some(Self::AUDIO_PREFILTER_CLASS_CONTENT)
}
"AUDIO_PREFILTER_CLASS_SILENT" => {
::core::option::Option::Some(Self::AUDIO_PREFILTER_CLASS_SILENT)
}
"AUDIO_PREFILTER_CLASS_NOISE" => {
::core::option::Option::Some(Self::AUDIO_PREFILTER_CLASS_NOISE)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::AUDIO_PREFILTER_CLASS_UNSPECIFIED,
Self::AUDIO_PREFILTER_CLASS_CONTENT,
Self::AUDIO_PREFILTER_CLASS_SILENT,
Self::AUDIO_PREFILTER_CLASS_NOISE,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum AudioTrackRole {
/// src `Unknown`
AUDIO_TRACK_ROLE_UNSPECIFIED = 0i32,
AUDIO_TRACK_ROLE_MAIN_PROGRAM = 1i32,
AUDIO_TRACK_ROLE_COMMENTARY = 2i32,
AUDIO_TRACK_ROLE_DUB = 3i32,
AUDIO_TRACK_ROLE_DESCRIPTIVE_AUDIO = 4i32,
AUDIO_TRACK_ROLE_KARAOKE = 5i32,
AUDIO_TRACK_ROLE_LYRICS = 6i32,
}
impl AudioTrackRole {
///Idiomatic alias for [`Self::AUDIO_TRACK_ROLE_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::AUDIO_TRACK_ROLE_UNSPECIFIED;
///Idiomatic alias for [`Self::AUDIO_TRACK_ROLE_MAIN_PROGRAM`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const MainProgram: Self = Self::AUDIO_TRACK_ROLE_MAIN_PROGRAM;
///Idiomatic alias for [`Self::AUDIO_TRACK_ROLE_COMMENTARY`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Commentary: Self = Self::AUDIO_TRACK_ROLE_COMMENTARY;
///Idiomatic alias for [`Self::AUDIO_TRACK_ROLE_DUB`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Dub: Self = Self::AUDIO_TRACK_ROLE_DUB;
///Idiomatic alias for [`Self::AUDIO_TRACK_ROLE_DESCRIPTIVE_AUDIO`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const DescriptiveAudio: Self = Self::AUDIO_TRACK_ROLE_DESCRIPTIVE_AUDIO;
///Idiomatic alias for [`Self::AUDIO_TRACK_ROLE_KARAOKE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Karaoke: Self = Self::AUDIO_TRACK_ROLE_KARAOKE;
///Idiomatic alias for [`Self::AUDIO_TRACK_ROLE_LYRICS`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Lyrics: Self = Self::AUDIO_TRACK_ROLE_LYRICS;
}
impl ::core::default::Default for AudioTrackRole {
fn default() -> Self {
Self::AUDIO_TRACK_ROLE_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for AudioTrackRole {
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 AudioTrackRole {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = AudioTrackRole;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(AudioTrackRole)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<AudioTrackRole, E> {
<AudioTrackRole 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<AudioTrackRole, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioTrackRole 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<AudioTrackRole, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioTrackRole 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<AudioTrackRole, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for AudioTrackRole {
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 AudioTrackRole {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_MAIN_PROGRAM),
2i32 => ::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_COMMENTARY),
3i32 => ::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_DUB),
4i32 => {
::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_DESCRIPTIVE_AUDIO)
}
5i32 => ::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_KARAOKE),
6i32 => ::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_LYRICS),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::AUDIO_TRACK_ROLE_UNSPECIFIED => "AUDIO_TRACK_ROLE_UNSPECIFIED",
Self::AUDIO_TRACK_ROLE_MAIN_PROGRAM => "AUDIO_TRACK_ROLE_MAIN_PROGRAM",
Self::AUDIO_TRACK_ROLE_COMMENTARY => "AUDIO_TRACK_ROLE_COMMENTARY",
Self::AUDIO_TRACK_ROLE_DUB => "AUDIO_TRACK_ROLE_DUB",
Self::AUDIO_TRACK_ROLE_DESCRIPTIVE_AUDIO => {
"AUDIO_TRACK_ROLE_DESCRIPTIVE_AUDIO"
}
Self::AUDIO_TRACK_ROLE_KARAOKE => "AUDIO_TRACK_ROLE_KARAOKE",
Self::AUDIO_TRACK_ROLE_LYRICS => "AUDIO_TRACK_ROLE_LYRICS",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"AUDIO_TRACK_ROLE_UNSPECIFIED" => {
::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_UNSPECIFIED)
}
"AUDIO_TRACK_ROLE_MAIN_PROGRAM" => {
::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_MAIN_PROGRAM)
}
"AUDIO_TRACK_ROLE_COMMENTARY" => {
::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_COMMENTARY)
}
"AUDIO_TRACK_ROLE_DUB" => {
::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_DUB)
}
"AUDIO_TRACK_ROLE_DESCRIPTIVE_AUDIO" => {
::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_DESCRIPTIVE_AUDIO)
}
"AUDIO_TRACK_ROLE_KARAOKE" => {
::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_KARAOKE)
}
"AUDIO_TRACK_ROLE_LYRICS" => {
::core::option::Option::Some(Self::AUDIO_TRACK_ROLE_LYRICS)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::AUDIO_TRACK_ROLE_UNSPECIFIED,
Self::AUDIO_TRACK_ROLE_MAIN_PROGRAM,
Self::AUDIO_TRACK_ROLE_COMMENTARY,
Self::AUDIO_TRACK_ROLE_DUB,
Self::AUDIO_TRACK_ROLE_DESCRIPTIVE_AUDIO,
Self::AUDIO_TRACK_ROLE_KARAOKE,
Self::AUDIO_TRACK_ROLE_LYRICS,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum AudioContainerFormat {
/// inserted (src define_code_type! 0=None)
AUDIO_CONTAINER_FORMAT_UNSPECIFIED = 0i32,
AUDIO_CONTAINER_FORMAT_MP4 = 1i32,
AUDIO_CONTAINER_FORMAT_MKV = 2i32,
AUDIO_CONTAINER_FORMAT_MOV = 3i32,
AUDIO_CONTAINER_FORMAT_WAV = 4i32,
AUDIO_CONTAINER_FORMAT_MP3 = 5i32,
AUDIO_CONTAINER_FORMAT_FLAC = 6i32,
AUDIO_CONTAINER_FORMAT_OGG = 7i32,
AUDIO_CONTAINER_FORMAT_MKA = 8i32,
AUDIO_CONTAINER_FORMAT_WMA = 9i32,
AUDIO_CONTAINER_FORMAT_AAC = 10i32,
}
impl AudioContainerFormat {
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::AUDIO_CONTAINER_FORMAT_UNSPECIFIED;
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_MP4`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mp4: Self = Self::AUDIO_CONTAINER_FORMAT_MP4;
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_MKV`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mkv: Self = Self::AUDIO_CONTAINER_FORMAT_MKV;
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_MOV`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mov: Self = Self::AUDIO_CONTAINER_FORMAT_MOV;
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_WAV`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Wav: Self = Self::AUDIO_CONTAINER_FORMAT_WAV;
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_MP3`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mp3: Self = Self::AUDIO_CONTAINER_FORMAT_MP3;
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_FLAC`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Flac: Self = Self::AUDIO_CONTAINER_FORMAT_FLAC;
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_OGG`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ogg: Self = Self::AUDIO_CONTAINER_FORMAT_OGG;
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_MKA`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mka: Self = Self::AUDIO_CONTAINER_FORMAT_MKA;
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_WMA`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Wma: Self = Self::AUDIO_CONTAINER_FORMAT_WMA;
///Idiomatic alias for [`Self::AUDIO_CONTAINER_FORMAT_AAC`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Aac: Self = Self::AUDIO_CONTAINER_FORMAT_AAC;
}
impl ::core::default::Default for AudioContainerFormat {
fn default() -> Self {
Self::AUDIO_CONTAINER_FORMAT_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for AudioContainerFormat {
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 AudioContainerFormat {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = AudioContainerFormat;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(AudioContainerFormat)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<AudioContainerFormat, E> {
<AudioContainerFormat 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<AudioContainerFormat, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioContainerFormat 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<AudioContainerFormat, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioContainerFormat 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<AudioContainerFormat, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for AudioContainerFormat {
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 AudioContainerFormat {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_UNSPECIFIED)
}
1i32 => ::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_MP4),
2i32 => ::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_MKV),
3i32 => ::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_MOV),
4i32 => ::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_WAV),
5i32 => ::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_MP3),
6i32 => ::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_FLAC),
7i32 => ::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_OGG),
8i32 => ::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_MKA),
9i32 => ::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_WMA),
10i32 => ::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_AAC),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::AUDIO_CONTAINER_FORMAT_UNSPECIFIED => {
"AUDIO_CONTAINER_FORMAT_UNSPECIFIED"
}
Self::AUDIO_CONTAINER_FORMAT_MP4 => "AUDIO_CONTAINER_FORMAT_MP4",
Self::AUDIO_CONTAINER_FORMAT_MKV => "AUDIO_CONTAINER_FORMAT_MKV",
Self::AUDIO_CONTAINER_FORMAT_MOV => "AUDIO_CONTAINER_FORMAT_MOV",
Self::AUDIO_CONTAINER_FORMAT_WAV => "AUDIO_CONTAINER_FORMAT_WAV",
Self::AUDIO_CONTAINER_FORMAT_MP3 => "AUDIO_CONTAINER_FORMAT_MP3",
Self::AUDIO_CONTAINER_FORMAT_FLAC => "AUDIO_CONTAINER_FORMAT_FLAC",
Self::AUDIO_CONTAINER_FORMAT_OGG => "AUDIO_CONTAINER_FORMAT_OGG",
Self::AUDIO_CONTAINER_FORMAT_MKA => "AUDIO_CONTAINER_FORMAT_MKA",
Self::AUDIO_CONTAINER_FORMAT_WMA => "AUDIO_CONTAINER_FORMAT_WMA",
Self::AUDIO_CONTAINER_FORMAT_AAC => "AUDIO_CONTAINER_FORMAT_AAC",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"AUDIO_CONTAINER_FORMAT_UNSPECIFIED" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_UNSPECIFIED)
}
"AUDIO_CONTAINER_FORMAT_MP4" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_MP4)
}
"AUDIO_CONTAINER_FORMAT_MKV" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_MKV)
}
"AUDIO_CONTAINER_FORMAT_MOV" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_MOV)
}
"AUDIO_CONTAINER_FORMAT_WAV" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_WAV)
}
"AUDIO_CONTAINER_FORMAT_MP3" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_MP3)
}
"AUDIO_CONTAINER_FORMAT_FLAC" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_FLAC)
}
"AUDIO_CONTAINER_FORMAT_OGG" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_OGG)
}
"AUDIO_CONTAINER_FORMAT_MKA" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_MKA)
}
"AUDIO_CONTAINER_FORMAT_WMA" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_WMA)
}
"AUDIO_CONTAINER_FORMAT_AAC" => {
::core::option::Option::Some(Self::AUDIO_CONTAINER_FORMAT_AAC)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::AUDIO_CONTAINER_FORMAT_UNSPECIFIED,
Self::AUDIO_CONTAINER_FORMAT_MP4,
Self::AUDIO_CONTAINER_FORMAT_MKV,
Self::AUDIO_CONTAINER_FORMAT_MOV,
Self::AUDIO_CONTAINER_FORMAT_WAV,
Self::AUDIO_CONTAINER_FORMAT_MP3,
Self::AUDIO_CONTAINER_FORMAT_FLAC,
Self::AUDIO_CONTAINER_FORMAT_OGG,
Self::AUDIO_CONTAINER_FORMAT_MKA,
Self::AUDIO_CONTAINER_FORMAT_WMA,
Self::AUDIO_CONTAINER_FORMAT_AAC,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum AudioCodec {
/// inserted
AUDIO_CODEC_UNSPECIFIED = 0i32,
AUDIO_CODEC_AAC = 1i32,
AUDIO_CODEC_FLAC = 2i32,
AUDIO_CODEC_OPUS = 3i32,
AUDIO_CODEC_MP3 = 4i32,
AUDIO_CODEC_PCM_S16LE = 5i32,
AUDIO_CODEC_AC3 = 6i32,
AUDIO_CODEC_VORBIS = 7i32,
}
impl AudioCodec {
///Idiomatic alias for [`Self::AUDIO_CODEC_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::AUDIO_CODEC_UNSPECIFIED;
///Idiomatic alias for [`Self::AUDIO_CODEC_AAC`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Aac: Self = Self::AUDIO_CODEC_AAC;
///Idiomatic alias for [`Self::AUDIO_CODEC_FLAC`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Flac: Self = Self::AUDIO_CODEC_FLAC;
///Idiomatic alias for [`Self::AUDIO_CODEC_OPUS`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Opus: Self = Self::AUDIO_CODEC_OPUS;
///Idiomatic alias for [`Self::AUDIO_CODEC_MP3`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mp3: Self = Self::AUDIO_CODEC_MP3;
///Idiomatic alias for [`Self::AUDIO_CODEC_PCM_S16LE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const PcmS16le: Self = Self::AUDIO_CODEC_PCM_S16LE;
///Idiomatic alias for [`Self::AUDIO_CODEC_AC3`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ac3: Self = Self::AUDIO_CODEC_AC3;
///Idiomatic alias for [`Self::AUDIO_CODEC_VORBIS`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Vorbis: Self = Self::AUDIO_CODEC_VORBIS;
}
impl ::core::default::Default for AudioCodec {
fn default() -> Self {
Self::AUDIO_CODEC_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for AudioCodec {
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 AudioCodec {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = AudioCodec;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(AudioCodec)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<AudioCodec, E> {
<AudioCodec 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<AudioCodec, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioCodec 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<AudioCodec, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioCodec 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<AudioCodec, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for AudioCodec {
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 AudioCodec {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::AUDIO_CODEC_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::AUDIO_CODEC_AAC),
2i32 => ::core::option::Option::Some(Self::AUDIO_CODEC_FLAC),
3i32 => ::core::option::Option::Some(Self::AUDIO_CODEC_OPUS),
4i32 => ::core::option::Option::Some(Self::AUDIO_CODEC_MP3),
5i32 => ::core::option::Option::Some(Self::AUDIO_CODEC_PCM_S16LE),
6i32 => ::core::option::Option::Some(Self::AUDIO_CODEC_AC3),
7i32 => ::core::option::Option::Some(Self::AUDIO_CODEC_VORBIS),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::AUDIO_CODEC_UNSPECIFIED => "AUDIO_CODEC_UNSPECIFIED",
Self::AUDIO_CODEC_AAC => "AUDIO_CODEC_AAC",
Self::AUDIO_CODEC_FLAC => "AUDIO_CODEC_FLAC",
Self::AUDIO_CODEC_OPUS => "AUDIO_CODEC_OPUS",
Self::AUDIO_CODEC_MP3 => "AUDIO_CODEC_MP3",
Self::AUDIO_CODEC_PCM_S16LE => "AUDIO_CODEC_PCM_S16LE",
Self::AUDIO_CODEC_AC3 => "AUDIO_CODEC_AC3",
Self::AUDIO_CODEC_VORBIS => "AUDIO_CODEC_VORBIS",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"AUDIO_CODEC_UNSPECIFIED" => {
::core::option::Option::Some(Self::AUDIO_CODEC_UNSPECIFIED)
}
"AUDIO_CODEC_AAC" => ::core::option::Option::Some(Self::AUDIO_CODEC_AAC),
"AUDIO_CODEC_FLAC" => ::core::option::Option::Some(Self::AUDIO_CODEC_FLAC),
"AUDIO_CODEC_OPUS" => ::core::option::Option::Some(Self::AUDIO_CODEC_OPUS),
"AUDIO_CODEC_MP3" => ::core::option::Option::Some(Self::AUDIO_CODEC_MP3),
"AUDIO_CODEC_PCM_S16LE" => {
::core::option::Option::Some(Self::AUDIO_CODEC_PCM_S16LE)
}
"AUDIO_CODEC_AC3" => ::core::option::Option::Some(Self::AUDIO_CODEC_AC3),
"AUDIO_CODEC_VORBIS" => {
::core::option::Option::Some(Self::AUDIO_CODEC_VORBIS)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::AUDIO_CODEC_UNSPECIFIED,
Self::AUDIO_CODEC_AAC,
Self::AUDIO_CODEC_FLAC,
Self::AUDIO_CODEC_OPUS,
Self::AUDIO_CODEC_MP3,
Self::AUDIO_CODEC_PCM_S16LE,
Self::AUDIO_CODEC_AC3,
Self::AUDIO_CODEC_VORBIS,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum AudioSampleFormat {
/// inserted
AUDIO_SAMPLE_FORMAT_UNSPECIFIED = 0i32,
AUDIO_SAMPLE_FORMAT_FLTP = 1i32,
AUDIO_SAMPLE_FORMAT_S16 = 2i32,
AUDIO_SAMPLE_FORMAT_S32 = 3i32,
AUDIO_SAMPLE_FORMAT_F32 = 4i32,
}
impl AudioSampleFormat {
///Idiomatic alias for [`Self::AUDIO_SAMPLE_FORMAT_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::AUDIO_SAMPLE_FORMAT_UNSPECIFIED;
///Idiomatic alias for [`Self::AUDIO_SAMPLE_FORMAT_FLTP`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Fltp: Self = Self::AUDIO_SAMPLE_FORMAT_FLTP;
///Idiomatic alias for [`Self::AUDIO_SAMPLE_FORMAT_S16`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const S16: Self = Self::AUDIO_SAMPLE_FORMAT_S16;
///Idiomatic alias for [`Self::AUDIO_SAMPLE_FORMAT_S32`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const S32: Self = Self::AUDIO_SAMPLE_FORMAT_S32;
///Idiomatic alias for [`Self::AUDIO_SAMPLE_FORMAT_F32`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const F32: Self = Self::AUDIO_SAMPLE_FORMAT_F32;
}
impl ::core::default::Default for AudioSampleFormat {
fn default() -> Self {
Self::AUDIO_SAMPLE_FORMAT_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for AudioSampleFormat {
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 AudioSampleFormat {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = AudioSampleFormat;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(AudioSampleFormat)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<AudioSampleFormat, E> {
<AudioSampleFormat 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<AudioSampleFormat, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioSampleFormat 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<AudioSampleFormat, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<AudioSampleFormat 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<AudioSampleFormat, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for AudioSampleFormat {
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 AudioSampleFormat {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::AUDIO_SAMPLE_FORMAT_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::AUDIO_SAMPLE_FORMAT_FLTP),
2i32 => ::core::option::Option::Some(Self::AUDIO_SAMPLE_FORMAT_S16),
3i32 => ::core::option::Option::Some(Self::AUDIO_SAMPLE_FORMAT_S32),
4i32 => ::core::option::Option::Some(Self::AUDIO_SAMPLE_FORMAT_F32),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::AUDIO_SAMPLE_FORMAT_UNSPECIFIED => "AUDIO_SAMPLE_FORMAT_UNSPECIFIED",
Self::AUDIO_SAMPLE_FORMAT_FLTP => "AUDIO_SAMPLE_FORMAT_FLTP",
Self::AUDIO_SAMPLE_FORMAT_S16 => "AUDIO_SAMPLE_FORMAT_S16",
Self::AUDIO_SAMPLE_FORMAT_S32 => "AUDIO_SAMPLE_FORMAT_S32",
Self::AUDIO_SAMPLE_FORMAT_F32 => "AUDIO_SAMPLE_FORMAT_F32",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"AUDIO_SAMPLE_FORMAT_UNSPECIFIED" => {
::core::option::Option::Some(Self::AUDIO_SAMPLE_FORMAT_UNSPECIFIED)
}
"AUDIO_SAMPLE_FORMAT_FLTP" => {
::core::option::Option::Some(Self::AUDIO_SAMPLE_FORMAT_FLTP)
}
"AUDIO_SAMPLE_FORMAT_S16" => {
::core::option::Option::Some(Self::AUDIO_SAMPLE_FORMAT_S16)
}
"AUDIO_SAMPLE_FORMAT_S32" => {
::core::option::Option::Some(Self::AUDIO_SAMPLE_FORMAT_S32)
}
"AUDIO_SAMPLE_FORMAT_F32" => {
::core::option::Option::Some(Self::AUDIO_SAMPLE_FORMAT_F32)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::AUDIO_SAMPLE_FORMAT_UNSPECIFIED,
Self::AUDIO_SAMPLE_FORMAT_FLTP,
Self::AUDIO_SAMPLE_FORMAT_S16,
Self::AUDIO_SAMPLE_FORMAT_S32,
Self::AUDIO_SAMPLE_FORMAT_F32,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum TrackClassificationType {
/// src `Unknown`
TRACK_CLASSIFICATION_TYPE_UNSPECIFIED = 0i32,
TRACK_CLASSIFICATION_TYPE_TIMECODE = 1i32,
TRACK_CLASSIFICATION_TYPE_SILENT = 2i32,
TRACK_CLASSIFICATION_TYPE_AMBIENCE = 3i32,
TRACK_CLASSIFICATION_TYPE_VOICE = 4i32,
TRACK_CLASSIFICATION_TYPE_MUSIC = 5i32,
TRACK_CLASSIFICATION_TYPE_SOUND_EFFECT = 6i32,
TRACK_CLASSIFICATION_TYPE_MIXED = 7i32,
}
impl TrackClassificationType {
///Idiomatic alias for [`Self::TRACK_CLASSIFICATION_TYPE_UNSPECIFIED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::TRACK_CLASSIFICATION_TYPE_UNSPECIFIED;
///Idiomatic alias for [`Self::TRACK_CLASSIFICATION_TYPE_TIMECODE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Timecode: Self = Self::TRACK_CLASSIFICATION_TYPE_TIMECODE;
///Idiomatic alias for [`Self::TRACK_CLASSIFICATION_TYPE_SILENT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Silent: Self = Self::TRACK_CLASSIFICATION_TYPE_SILENT;
///Idiomatic alias for [`Self::TRACK_CLASSIFICATION_TYPE_AMBIENCE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ambience: Self = Self::TRACK_CLASSIFICATION_TYPE_AMBIENCE;
///Idiomatic alias for [`Self::TRACK_CLASSIFICATION_TYPE_VOICE`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Voice: Self = Self::TRACK_CLASSIFICATION_TYPE_VOICE;
///Idiomatic alias for [`Self::TRACK_CLASSIFICATION_TYPE_MUSIC`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Music: Self = Self::TRACK_CLASSIFICATION_TYPE_MUSIC;
///Idiomatic alias for [`Self::TRACK_CLASSIFICATION_TYPE_SOUND_EFFECT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const SoundEffect: Self = Self::TRACK_CLASSIFICATION_TYPE_SOUND_EFFECT;
///Idiomatic alias for [`Self::TRACK_CLASSIFICATION_TYPE_MIXED`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Mixed: Self = Self::TRACK_CLASSIFICATION_TYPE_MIXED;
}
impl ::core::default::Default for TrackClassificationType {
fn default() -> Self {
Self::TRACK_CLASSIFICATION_TYPE_UNSPECIFIED
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for TrackClassificationType {
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 TrackClassificationType {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = TrackClassificationType;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(TrackClassificationType)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<TrackClassificationType, E> {
<TrackClassificationType 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<TrackClassificationType, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<TrackClassificationType 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<TrackClassificationType, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<TrackClassificationType 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<TrackClassificationType, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for TrackClassificationType {
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 TrackClassificationType {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => {
::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_UNSPECIFIED)
}
1i32 => {
::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_TIMECODE)
}
2i32 => ::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_SILENT),
3i32 => {
::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_AMBIENCE)
}
4i32 => ::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_VOICE),
5i32 => ::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_MUSIC),
6i32 => {
::core::option::Option::Some(
Self::TRACK_CLASSIFICATION_TYPE_SOUND_EFFECT,
)
}
7i32 => ::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_MIXED),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::TRACK_CLASSIFICATION_TYPE_UNSPECIFIED => {
"TRACK_CLASSIFICATION_TYPE_UNSPECIFIED"
}
Self::TRACK_CLASSIFICATION_TYPE_TIMECODE => {
"TRACK_CLASSIFICATION_TYPE_TIMECODE"
}
Self::TRACK_CLASSIFICATION_TYPE_SILENT => "TRACK_CLASSIFICATION_TYPE_SILENT",
Self::TRACK_CLASSIFICATION_TYPE_AMBIENCE => {
"TRACK_CLASSIFICATION_TYPE_AMBIENCE"
}
Self::TRACK_CLASSIFICATION_TYPE_VOICE => "TRACK_CLASSIFICATION_TYPE_VOICE",
Self::TRACK_CLASSIFICATION_TYPE_MUSIC => "TRACK_CLASSIFICATION_TYPE_MUSIC",
Self::TRACK_CLASSIFICATION_TYPE_SOUND_EFFECT => {
"TRACK_CLASSIFICATION_TYPE_SOUND_EFFECT"
}
Self::TRACK_CLASSIFICATION_TYPE_MIXED => "TRACK_CLASSIFICATION_TYPE_MIXED",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"TRACK_CLASSIFICATION_TYPE_UNSPECIFIED" => {
::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_UNSPECIFIED)
}
"TRACK_CLASSIFICATION_TYPE_TIMECODE" => {
::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_TIMECODE)
}
"TRACK_CLASSIFICATION_TYPE_SILENT" => {
::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_SILENT)
}
"TRACK_CLASSIFICATION_TYPE_AMBIENCE" => {
::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_AMBIENCE)
}
"TRACK_CLASSIFICATION_TYPE_VOICE" => {
::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_VOICE)
}
"TRACK_CLASSIFICATION_TYPE_MUSIC" => {
::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_MUSIC)
}
"TRACK_CLASSIFICATION_TYPE_SOUND_EFFECT" => {
::core::option::Option::Some(
Self::TRACK_CLASSIFICATION_TYPE_SOUND_EFFECT,
)
}
"TRACK_CLASSIFICATION_TYPE_MIXED" => {
::core::option::Option::Some(Self::TRACK_CLASSIFICATION_TYPE_MIXED)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::TRACK_CLASSIFICATION_TYPE_UNSPECIFIED,
Self::TRACK_CLASSIFICATION_TYPE_TIMECODE,
Self::TRACK_CLASSIFICATION_TYPE_SILENT,
Self::TRACK_CLASSIFICATION_TYPE_AMBIENCE,
Self::TRACK_CLASSIFICATION_TYPE_VOICE,
Self::TRACK_CLASSIFICATION_TYPE_MUSIC,
Self::TRACK_CLASSIFICATION_TYPE_SOUND_EFFECT,
Self::TRACK_CLASSIFICATION_TYPE_MIXED,
]
}
}
/// Closed discriminator for \[`SubtitleCue`\]'s `data` payload. Numbering is
/// 1:1 with the domain `SubtitleCueKind` `repr(u8)` (no leading
/// `UNSPECIFIED = 0` — every value is a real format, including SRT at 0).
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum SubtitleCueKind {
SUBTITLE_CUE_KIND_SRT = 0i32,
SUBTITLE_CUE_KIND_VTT = 1i32,
SUBTITLE_CUE_KIND_ASS = 2i32,
SUBTITLE_CUE_KIND_MICRO_DVD = 3i32,
SUBTITLE_CUE_KIND_SUB_VIEWER = 4i32,
SUBTITLE_CUE_KIND_SBV = 5i32,
SUBTITLE_CUE_KIND_LRC = 6i32,
SUBTITLE_CUE_KIND_TTML = 7i32,
SUBTITLE_CUE_KIND_SAMI = 8i32,
SUBTITLE_CUE_KIND_VOB_SUB = 9i32,
SUBTITLE_CUE_KIND_PGS = 10i32,
SUBTITLE_CUE_KIND_CEA_608 = 11i32,
SUBTITLE_CUE_KIND_EBU_STL = 12i32,
}
impl SubtitleCueKind {
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_SRT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Srt: Self = Self::SUBTITLE_CUE_KIND_SRT;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_VTT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Vtt: Self = Self::SUBTITLE_CUE_KIND_VTT;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_ASS`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ass: Self = Self::SUBTITLE_CUE_KIND_ASS;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_MICRO_DVD`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const MicroDvd: Self = Self::SUBTITLE_CUE_KIND_MICRO_DVD;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_SUB_VIEWER`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const SubViewer: Self = Self::SUBTITLE_CUE_KIND_SUB_VIEWER;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_SBV`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Sbv: Self = Self::SUBTITLE_CUE_KIND_SBV;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_LRC`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Lrc: Self = Self::SUBTITLE_CUE_KIND_LRC;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_TTML`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Ttml: Self = Self::SUBTITLE_CUE_KIND_TTML;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_SAMI`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Sami: Self = Self::SUBTITLE_CUE_KIND_SAMI;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_VOB_SUB`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const VobSub: Self = Self::SUBTITLE_CUE_KIND_VOB_SUB;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_PGS`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Pgs: Self = Self::SUBTITLE_CUE_KIND_PGS;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_CEA_608`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Cea608: Self = Self::SUBTITLE_CUE_KIND_CEA_608;
///Idiomatic alias for [`Self::SUBTITLE_CUE_KIND_EBU_STL`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const EbuStl: Self = Self::SUBTITLE_CUE_KIND_EBU_STL;
}
impl ::core::default::Default for SubtitleCueKind {
fn default() -> Self {
Self::SUBTITLE_CUE_KIND_SRT
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for SubtitleCueKind {
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 SubtitleCueKind {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = SubtitleCueKind;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(SubtitleCueKind)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<SubtitleCueKind, E> {
<SubtitleCueKind 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<SubtitleCueKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<SubtitleCueKind 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<SubtitleCueKind, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<SubtitleCueKind 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<SubtitleCueKind, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for SubtitleCueKind {
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 SubtitleCueKind {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_SRT),
1i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_VTT),
2i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_ASS),
3i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_MICRO_DVD),
4i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_SUB_VIEWER),
5i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_SBV),
6i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_LRC),
7i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_TTML),
8i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_SAMI),
9i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_VOB_SUB),
10i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_PGS),
11i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_CEA_608),
12i32 => ::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_EBU_STL),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::SUBTITLE_CUE_KIND_SRT => "SUBTITLE_CUE_KIND_SRT",
Self::SUBTITLE_CUE_KIND_VTT => "SUBTITLE_CUE_KIND_VTT",
Self::SUBTITLE_CUE_KIND_ASS => "SUBTITLE_CUE_KIND_ASS",
Self::SUBTITLE_CUE_KIND_MICRO_DVD => "SUBTITLE_CUE_KIND_MICRO_DVD",
Self::SUBTITLE_CUE_KIND_SUB_VIEWER => "SUBTITLE_CUE_KIND_SUB_VIEWER",
Self::SUBTITLE_CUE_KIND_SBV => "SUBTITLE_CUE_KIND_SBV",
Self::SUBTITLE_CUE_KIND_LRC => "SUBTITLE_CUE_KIND_LRC",
Self::SUBTITLE_CUE_KIND_TTML => "SUBTITLE_CUE_KIND_TTML",
Self::SUBTITLE_CUE_KIND_SAMI => "SUBTITLE_CUE_KIND_SAMI",
Self::SUBTITLE_CUE_KIND_VOB_SUB => "SUBTITLE_CUE_KIND_VOB_SUB",
Self::SUBTITLE_CUE_KIND_PGS => "SUBTITLE_CUE_KIND_PGS",
Self::SUBTITLE_CUE_KIND_CEA_608 => "SUBTITLE_CUE_KIND_CEA_608",
Self::SUBTITLE_CUE_KIND_EBU_STL => "SUBTITLE_CUE_KIND_EBU_STL",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"SUBTITLE_CUE_KIND_SRT" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_SRT)
}
"SUBTITLE_CUE_KIND_VTT" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_VTT)
}
"SUBTITLE_CUE_KIND_ASS" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_ASS)
}
"SUBTITLE_CUE_KIND_MICRO_DVD" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_MICRO_DVD)
}
"SUBTITLE_CUE_KIND_SUB_VIEWER" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_SUB_VIEWER)
}
"SUBTITLE_CUE_KIND_SBV" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_SBV)
}
"SUBTITLE_CUE_KIND_LRC" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_LRC)
}
"SUBTITLE_CUE_KIND_TTML" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_TTML)
}
"SUBTITLE_CUE_KIND_SAMI" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_SAMI)
}
"SUBTITLE_CUE_KIND_VOB_SUB" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_VOB_SUB)
}
"SUBTITLE_CUE_KIND_PGS" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_PGS)
}
"SUBTITLE_CUE_KIND_CEA_608" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_CEA_608)
}
"SUBTITLE_CUE_KIND_EBU_STL" => {
::core::option::Option::Some(Self::SUBTITLE_CUE_KIND_EBU_STL)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::SUBTITLE_CUE_KIND_SRT,
Self::SUBTITLE_CUE_KIND_VTT,
Self::SUBTITLE_CUE_KIND_ASS,
Self::SUBTITLE_CUE_KIND_MICRO_DVD,
Self::SUBTITLE_CUE_KIND_SUB_VIEWER,
Self::SUBTITLE_CUE_KIND_SBV,
Self::SUBTITLE_CUE_KIND_LRC,
Self::SUBTITLE_CUE_KIND_TTML,
Self::SUBTITLE_CUE_KIND_SAMI,
Self::SUBTITLE_CUE_KIND_VOB_SUB,
Self::SUBTITLE_CUE_KIND_PGS,
Self::SUBTITLE_CUE_KIND_CEA_608,
Self::SUBTITLE_CUE_KIND_EBU_STL,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum VttVertical {
VTT_VERTICAL_LR = 0i32,
VTT_VERTICAL_RL = 1i32,
}
impl VttVertical {
///Idiomatic alias for [`Self::VTT_VERTICAL_LR`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Lr: Self = Self::VTT_VERTICAL_LR;
///Idiomatic alias for [`Self::VTT_VERTICAL_RL`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Rl: Self = Self::VTT_VERTICAL_RL;
}
impl ::core::default::Default for VttVertical {
fn default() -> Self {
Self::VTT_VERTICAL_LR
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for VttVertical {
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 VttVertical {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = VttVertical;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(VttVertical)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<VttVertical, E> {
<VttVertical 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<VttVertical, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<VttVertical 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<VttVertical, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<VttVertical 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<VttVertical, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for VttVertical {
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 VttVertical {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::VTT_VERTICAL_LR),
1i32 => ::core::option::Option::Some(Self::VTT_VERTICAL_RL),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::VTT_VERTICAL_LR => "VTT_VERTICAL_LR",
Self::VTT_VERTICAL_RL => "VTT_VERTICAL_RL",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"VTT_VERTICAL_LR" => ::core::option::Option::Some(Self::VTT_VERTICAL_LR),
"VTT_VERTICAL_RL" => ::core::option::Option::Some(Self::VTT_VERTICAL_RL),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::VTT_VERTICAL_LR, Self::VTT_VERTICAL_RL]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum VttLineAlign {
VTT_LINE_ALIGN_START = 0i32,
VTT_LINE_ALIGN_CENTER = 1i32,
VTT_LINE_ALIGN_END = 2i32,
}
impl VttLineAlign {
///Idiomatic alias for [`Self::VTT_LINE_ALIGN_START`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Start: Self = Self::VTT_LINE_ALIGN_START;
///Idiomatic alias for [`Self::VTT_LINE_ALIGN_CENTER`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Center: Self = Self::VTT_LINE_ALIGN_CENTER;
///Idiomatic alias for [`Self::VTT_LINE_ALIGN_END`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const End: Self = Self::VTT_LINE_ALIGN_END;
}
impl ::core::default::Default for VttLineAlign {
fn default() -> Self {
Self::VTT_LINE_ALIGN_START
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for VttLineAlign {
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 VttLineAlign {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = VttLineAlign;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(VttLineAlign)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<VttLineAlign, E> {
<VttLineAlign 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<VttLineAlign, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<VttLineAlign 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<VttLineAlign, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<VttLineAlign 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<VttLineAlign, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for VttLineAlign {
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 VttLineAlign {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::VTT_LINE_ALIGN_START),
1i32 => ::core::option::Option::Some(Self::VTT_LINE_ALIGN_CENTER),
2i32 => ::core::option::Option::Some(Self::VTT_LINE_ALIGN_END),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::VTT_LINE_ALIGN_START => "VTT_LINE_ALIGN_START",
Self::VTT_LINE_ALIGN_CENTER => "VTT_LINE_ALIGN_CENTER",
Self::VTT_LINE_ALIGN_END => "VTT_LINE_ALIGN_END",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"VTT_LINE_ALIGN_START" => {
::core::option::Option::Some(Self::VTT_LINE_ALIGN_START)
}
"VTT_LINE_ALIGN_CENTER" => {
::core::option::Option::Some(Self::VTT_LINE_ALIGN_CENTER)
}
"VTT_LINE_ALIGN_END" => {
::core::option::Option::Some(Self::VTT_LINE_ALIGN_END)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::VTT_LINE_ALIGN_START,
Self::VTT_LINE_ALIGN_CENTER,
Self::VTT_LINE_ALIGN_END,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum VttPositionAlign {
VTT_POSITION_ALIGN_START = 0i32,
VTT_POSITION_ALIGN_CENTER = 1i32,
VTT_POSITION_ALIGN_END = 2i32,
VTT_POSITION_ALIGN_LINE_LEFT = 3i32,
VTT_POSITION_ALIGN_LINE_RIGHT = 4i32,
}
impl VttPositionAlign {
///Idiomatic alias for [`Self::VTT_POSITION_ALIGN_START`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Start: Self = Self::VTT_POSITION_ALIGN_START;
///Idiomatic alias for [`Self::VTT_POSITION_ALIGN_CENTER`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Center: Self = Self::VTT_POSITION_ALIGN_CENTER;
///Idiomatic alias for [`Self::VTT_POSITION_ALIGN_END`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const End: Self = Self::VTT_POSITION_ALIGN_END;
///Idiomatic alias for [`Self::VTT_POSITION_ALIGN_LINE_LEFT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const LineLeft: Self = Self::VTT_POSITION_ALIGN_LINE_LEFT;
///Idiomatic alias for [`Self::VTT_POSITION_ALIGN_LINE_RIGHT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const LineRight: Self = Self::VTT_POSITION_ALIGN_LINE_RIGHT;
}
impl ::core::default::Default for VttPositionAlign {
fn default() -> Self {
Self::VTT_POSITION_ALIGN_START
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for VttPositionAlign {
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 VttPositionAlign {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = VttPositionAlign;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ",
stringify!(VttPositionAlign)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<VttPositionAlign, E> {
<VttPositionAlign 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<VttPositionAlign, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<VttPositionAlign 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<VttPositionAlign, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<VttPositionAlign 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<VttPositionAlign, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for VttPositionAlign {
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 VttPositionAlign {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::VTT_POSITION_ALIGN_START),
1i32 => ::core::option::Option::Some(Self::VTT_POSITION_ALIGN_CENTER),
2i32 => ::core::option::Option::Some(Self::VTT_POSITION_ALIGN_END),
3i32 => ::core::option::Option::Some(Self::VTT_POSITION_ALIGN_LINE_LEFT),
4i32 => ::core::option::Option::Some(Self::VTT_POSITION_ALIGN_LINE_RIGHT),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::VTT_POSITION_ALIGN_START => "VTT_POSITION_ALIGN_START",
Self::VTT_POSITION_ALIGN_CENTER => "VTT_POSITION_ALIGN_CENTER",
Self::VTT_POSITION_ALIGN_END => "VTT_POSITION_ALIGN_END",
Self::VTT_POSITION_ALIGN_LINE_LEFT => "VTT_POSITION_ALIGN_LINE_LEFT",
Self::VTT_POSITION_ALIGN_LINE_RIGHT => "VTT_POSITION_ALIGN_LINE_RIGHT",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"VTT_POSITION_ALIGN_START" => {
::core::option::Option::Some(Self::VTT_POSITION_ALIGN_START)
}
"VTT_POSITION_ALIGN_CENTER" => {
::core::option::Option::Some(Self::VTT_POSITION_ALIGN_CENTER)
}
"VTT_POSITION_ALIGN_END" => {
::core::option::Option::Some(Self::VTT_POSITION_ALIGN_END)
}
"VTT_POSITION_ALIGN_LINE_LEFT" => {
::core::option::Option::Some(Self::VTT_POSITION_ALIGN_LINE_LEFT)
}
"VTT_POSITION_ALIGN_LINE_RIGHT" => {
::core::option::Option::Some(Self::VTT_POSITION_ALIGN_LINE_RIGHT)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::VTT_POSITION_ALIGN_START,
Self::VTT_POSITION_ALIGN_CENTER,
Self::VTT_POSITION_ALIGN_END,
Self::VTT_POSITION_ALIGN_LINE_LEFT,
Self::VTT_POSITION_ALIGN_LINE_RIGHT,
]
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[repr(i32)]
pub enum VttTextAlign {
VTT_TEXT_ALIGN_START = 0i32,
VTT_TEXT_ALIGN_CENTER = 1i32,
VTT_TEXT_ALIGN_END = 2i32,
VTT_TEXT_ALIGN_LEFT = 3i32,
VTT_TEXT_ALIGN_RIGHT = 4i32,
}
impl VttTextAlign {
///Idiomatic alias for [`Self::VTT_TEXT_ALIGN_START`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Start: Self = Self::VTT_TEXT_ALIGN_START;
///Idiomatic alias for [`Self::VTT_TEXT_ALIGN_CENTER`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Center: Self = Self::VTT_TEXT_ALIGN_CENTER;
///Idiomatic alias for [`Self::VTT_TEXT_ALIGN_END`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const End: Self = Self::VTT_TEXT_ALIGN_END;
///Idiomatic alias for [`Self::VTT_TEXT_ALIGN_LEFT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Left: Self = Self::VTT_TEXT_ALIGN_LEFT;
///Idiomatic alias for [`Self::VTT_TEXT_ALIGN_RIGHT`]; `Debug` prints the variant name.
#[allow(non_upper_case_globals)]
pub const Right: Self = Self::VTT_TEXT_ALIGN_RIGHT;
}
impl ::core::default::Default for VttTextAlign {
fn default() -> Self {
Self::VTT_TEXT_ALIGN_START
}
}
#[cfg(feature = "json")]
const _: () = {
impl ::serde::Serialize for VttTextAlign {
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 VttTextAlign {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = VttTextAlign;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(VttTextAlign)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<VttTextAlign, E> {
<VttTextAlign 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<VttTextAlign, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<VttTextAlign 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<VttTextAlign, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<VttTextAlign 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<VttTextAlign, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for VttTextAlign {
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 VttTextAlign {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::VTT_TEXT_ALIGN_START),
1i32 => ::core::option::Option::Some(Self::VTT_TEXT_ALIGN_CENTER),
2i32 => ::core::option::Option::Some(Self::VTT_TEXT_ALIGN_END),
3i32 => ::core::option::Option::Some(Self::VTT_TEXT_ALIGN_LEFT),
4i32 => ::core::option::Option::Some(Self::VTT_TEXT_ALIGN_RIGHT),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::VTT_TEXT_ALIGN_START => "VTT_TEXT_ALIGN_START",
Self::VTT_TEXT_ALIGN_CENTER => "VTT_TEXT_ALIGN_CENTER",
Self::VTT_TEXT_ALIGN_END => "VTT_TEXT_ALIGN_END",
Self::VTT_TEXT_ALIGN_LEFT => "VTT_TEXT_ALIGN_LEFT",
Self::VTT_TEXT_ALIGN_RIGHT => "VTT_TEXT_ALIGN_RIGHT",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"VTT_TEXT_ALIGN_START" => {
::core::option::Option::Some(Self::VTT_TEXT_ALIGN_START)
}
"VTT_TEXT_ALIGN_CENTER" => {
::core::option::Option::Some(Self::VTT_TEXT_ALIGN_CENTER)
}
"VTT_TEXT_ALIGN_END" => {
::core::option::Option::Some(Self::VTT_TEXT_ALIGN_END)
}
"VTT_TEXT_ALIGN_LEFT" => {
::core::option::Option::Some(Self::VTT_TEXT_ALIGN_LEFT)
}
"VTT_TEXT_ALIGN_RIGHT" => {
::core::option::Option::Some(Self::VTT_TEXT_ALIGN_RIGHT)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::VTT_TEXT_ALIGN_START,
Self::VTT_TEXT_ALIGN_CENTER,
Self::VTT_TEXT_ALIGN_END,
Self::VTT_TEXT_ALIGN_LEFT,
Self::VTT_TEXT_ALIGN_RIGHT,
]
}
}
/// Classification result: a label and its confidence score.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Detection {
/// Field 1: `label`
#[cfg_attr(
feature = "json",
serde(
rename = "label",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub label: ::buffa::smol_str::SmolStr,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Detection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Detection")
.field("label", &self.label)
.field("confidence", &self.confidence)
.finish()
}
}
impl Detection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Detection";
}
impl ::buffa::DefaultInstance for Detection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Detection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Detection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Detection";
const FULL_NAME: &'static str = "media.v1.Detection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Detection";
}
impl ::buffa::Message for Detection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.label.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.label, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.label = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.label = ::core::default::Default::default();
self.confidence = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Detection {
const PROTO_FQN: &'static str = "media.v1.Detection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Detection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Detection",
to_json: ::buffa::type_registry::any_to_json::<Detection>,
from_json: ::buffa::type_registry::any_from_json::<Detection>,
is_wkt: false,
};
/// Normalized image rectangle (x, y, width, height in \[0, 1\]).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct BoundingBox {
/// Field 1: `x`
#[cfg_attr(
feature = "json",
serde(
rename = "x",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub x: f32,
/// Field 2: `y`
#[cfg_attr(
feature = "json",
serde(
rename = "y",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub y: f32,
/// Field 3: `width`
#[cfg_attr(
feature = "json",
serde(
rename = "width",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub width: f32,
/// Field 4: `height`
#[cfg_attr(
feature = "json",
serde(
rename = "height",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub height: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BoundingBox {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BoundingBox")
.field("x", &self.x)
.field("y", &self.y)
.field("width", &self.width)
.field("height", &self.height)
.finish()
}
}
impl BoundingBox {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BoundingBox";
}
impl ::buffa::DefaultInstance for BoundingBox {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<BoundingBox> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for BoundingBox {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "BoundingBox";
const FULL_NAME: &'static str = "media.v1.BoundingBox";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BoundingBox";
}
impl ::buffa::Message for BoundingBox {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.x.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.y.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.width.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.height.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.x.to_bits() != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.x, buf);
}
if self.y.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.y, buf);
}
if self.width.to_bits() != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.width, buf);
}
if self.height.to_bits() != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.height, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.x = ::buffa::types::decode_float(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.y = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.width = ::buffa::types::decode_float(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.height = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.x = 0f32;
self.y = 0f32;
self.width = 0f32;
self.height = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BoundingBox {
const PROTO_FQN: &'static str = "media.v1.BoundingBox";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for BoundingBox {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __BOUNDING_BOX_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.BoundingBox",
to_json: ::buffa::type_registry::any_to_json::<BoundingBox>,
from_json: ::buffa::type_registry::any_from_json::<BoundingBox>,
is_wkt: false,
};
/// SP0 integration fixture (NOT a domain message): deliberately exercises BOTH
/// extern code paths — `range` is an extern message that itself nests an extern
/// `Timebase`, and `timebase` is a direct singular extern message field. The two
/// timebases are independent by design (no authoritative-source semantics); this
/// type exists only to prove the buffa \<-\> mediatime extern pipeline round-trips.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct TimedDetection {
/// Field 1: `detection`
#[cfg_attr(
feature = "json",
serde(
rename = "detection",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub detection: ::buffa::MessageField<Detection>,
/// Field 2: `range`
#[cfg_attr(
feature = "json",
serde(
rename = "range",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub range: ::buffa::MessageField<::mediatime::TimeRange>,
/// Field 3: `timebase`
#[cfg_attr(
feature = "json",
serde(
rename = "timebase",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub timebase: ::buffa::MessageField<::mediatime::Timebase>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for TimedDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("TimedDetection")
.field("detection", &self.detection)
.field("range", &self.range)
.field("timebase", &self.timebase)
.finish()
}
}
impl TimedDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TimedDetection";
}
impl ::buffa::DefaultInstance for TimedDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<TimedDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for TimedDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "TimedDetection";
const FULL_NAME: &'static str = "media.v1.TimedDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TimedDetection";
}
impl ::buffa::Message for TimedDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.detection.is_set() {
let __slot = __cache.reserve();
let inner_size = self.detection.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.range.is_set() {
let __slot = __cache.reserve();
let inner_size = self.range.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.timebase.is_set() {
let __slot = __cache.reserve();
let inner_size = self.timebase.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.detection.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.detection.write_to(__cache, buf);
}
if self.range.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.range.write_to(__cache, buf);
}
if self.timebase.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.timebase.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.detection.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.range.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.timebase.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.detection = ::buffa::MessageField::none();
self.range = ::buffa::MessageField::none();
self.timebase = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for TimedDetection {
const PROTO_FQN: &'static str = "media.v1.TimedDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for TimedDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TIMED_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.TimedDetection",
to_json: ::buffa::type_registry::any_to_json::<TimedDetection>,
from_json: ::buffa::type_registry::any_from_json::<TimedDetection>,
is_wkt: false,
};
/// Normalized 2D point (x, y).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Point2D {
/// Field 1: `x`
#[cfg_attr(
feature = "json",
serde(
rename = "x",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub x: f32,
/// Field 2: `y`
#[cfg_attr(
feature = "json",
serde(
rename = "y",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub y: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Point2D {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Point2D").field("x", &self.x).field("y", &self.y).finish()
}
}
impl Point2D {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Point2D";
}
impl ::buffa::DefaultInstance for Point2D {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Point2D> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Point2D {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Point2D";
const FULL_NAME: &'static str = "media.v1.Point2D";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Point2D";
}
impl ::buffa::Message for Point2D {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.x.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.y.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.x.to_bits() != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.x, buf);
}
if self.y.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.y, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.x = ::buffa::types::decode_float(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.y = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.x = 0f32;
self.y = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Point2D {
const PROTO_FQN: &'static str = "media.v1.Point2D";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Point2D {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __POINT2D_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Point2D",
to_json: ::buffa::type_registry::any_to_json::<Point2D>,
from_json: ::buffa::type_registry::any_from_json::<Point2D>,
is_wkt: false,
};
/// Pixel dimensions (split from findit-proto's packed u16|u16 — clean redesign).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Dimensions {
/// Field 1: `width`
#[cfg_attr(
feature = "json",
serde(
rename = "width",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub width: u32,
/// Field 2: `height`
#[cfg_attr(
feature = "json",
serde(
rename = "height",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub height: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Dimensions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Dimensions")
.field("width", &self.width)
.field("height", &self.height)
.finish()
}
}
impl Dimensions {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Dimensions";
}
impl ::buffa::DefaultInstance for Dimensions {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Dimensions> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Dimensions {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Dimensions";
const FULL_NAME: &'static str = "media.v1.Dimensions";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Dimensions";
}
impl ::buffa::Message for Dimensions {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.width != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.width) as u32;
}
if self.height != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.height) 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.width != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.width, buf);
}
if self.height != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.height, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.width = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.height = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.width = 0u32;
self.height = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Dimensions {
const PROTO_FQN: &'static str = "media.v1.Dimensions";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Dimensions {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __DIMENSIONS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Dimensions",
to_json: ::buffa::type_registry::any_to_json::<Dimensions>,
from_json: ::buffa::type_registry::any_from_json::<Dimensions>,
is_wkt: false,
};
/// Image aesthetics score (VNCalculateImageAestheticsScoresRequest).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Aesthetics {
/// Field 1: `overall_score`
#[cfg_attr(
feature = "json",
serde(
rename = "overallScore",
alias = "overall_score",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub overall_score: f32,
/// Field 2: `is_utility`
#[cfg_attr(
feature = "json",
serde(
rename = "isUtility",
alias = "is_utility",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub is_utility: bool,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Aesthetics {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Aesthetics")
.field("overall_score", &self.overall_score)
.field("is_utility", &self.is_utility)
.finish()
}
}
impl Aesthetics {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Aesthetics";
}
impl ::buffa::DefaultInstance for Aesthetics {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Aesthetics> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Aesthetics {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Aesthetics";
const FULL_NAME: &'static str = "media.v1.Aesthetics";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Aesthetics";
}
impl ::buffa::Message for Aesthetics {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.overall_score.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.is_utility {
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.overall_score.to_bits() != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.overall_score, buf);
}
if self.is_utility {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.is_utility, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.overall_score = ::buffa::types::decode_float(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.is_utility = ::buffa::types::decode_bool(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.overall_score = 0f32;
self.is_utility = false;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Aesthetics {
const PROTO_FQN: &'static str = "media.v1.Aesthetics";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Aesthetics {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AESTHETICS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Aesthetics",
to_json: ::buffa::type_registry::any_to_json::<Aesthetics>,
from_json: ::buffa::type_registry::any_from_json::<Aesthetics>,
is_wkt: false,
};
/// Detected horizon line (VNDetectHorizonRequest): signed angle + confidence.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct HorizonInfo {
/// Field 1: `angle`
#[cfg_attr(
feature = "json",
serde(
rename = "angle",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub angle: f32,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for HorizonInfo {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("HorizonInfo")
.field("angle", &self.angle)
.field("confidence", &self.confidence)
.finish()
}
}
impl HorizonInfo {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.HorizonInfo";
}
impl ::buffa::DefaultInstance for HorizonInfo {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<HorizonInfo> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for HorizonInfo {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "HorizonInfo";
const FULL_NAME: &'static str = "media.v1.HorizonInfo";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.HorizonInfo";
}
impl ::buffa::Message for HorizonInfo {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.angle.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.angle.to_bits() != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.angle, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.angle = ::buffa::types::decode_float(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.angle = 0f32;
self.confidence = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for HorizonInfo {
const PROTO_FQN: &'static str = "media.v1.HorizonInfo";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for HorizonInfo {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __HORIZON_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.HorizonInfo",
to_json: ::buffa::type_registry::any_to_json::<HorizonInfo>,
from_json: ::buffa::type_registry::any_from_json::<HorizonInfo>,
is_wkt: false,
};
/// Opaque FFmpeg AVCodecID codec identifier.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct CodecId {
/// Field 1: `value`
#[cfg_attr(
feature = "json",
serde(
rename = "value",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub value: i64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CodecId {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CodecId").field("value", &self.value).finish()
}
}
impl CodecId {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.CodecId";
}
impl ::buffa::DefaultInstance for CodecId {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<CodecId> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for CodecId {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "CodecId";
const FULL_NAME: &'static str = "media.v1.CodecId";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.CodecId";
}
impl ::buffa::Message for CodecId {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.value != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.value) 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.value != 0i64 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.value, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.value = ::buffa::types::decode_int64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.value = 0i64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CodecId {
const PROTO_FQN: &'static str = "media.v1.CodecId";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for CodecId {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __CODEC_ID_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.CodecId",
to_json: ::buffa::type_registry::any_to_json::<CodecId>,
from_json: ::buffa::type_registry::any_from_json::<CodecId>,
is_wkt: false,
};
/// Perceptual feature vector (VNGenerateImageFeaturePrintRequest).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct FeaturePrint {
/// Field 1: `data`
#[cfg_attr(
feature = "json",
serde(
rename = "data",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub data: ::buffa::bytes::Bytes,
/// Field 2: `element_type`
#[cfg_attr(
feature = "json",
serde(
rename = "elementType",
alias = "element_type",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub element_type: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FeaturePrint {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FeaturePrint")
.field("data", &self.data)
.field("element_type", &self.element_type)
.finish()
}
}
impl FeaturePrint {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FeaturePrint";
}
impl ::buffa::DefaultInstance for FeaturePrint {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FeaturePrint> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for FeaturePrint {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "FeaturePrint";
const FULL_NAME: &'static str = "media.v1.FeaturePrint";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FeaturePrint";
}
impl ::buffa::Message for FeaturePrint {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.data.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.data) as u32;
}
if self.element_type != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.element_type) 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.data.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.data, buf);
}
if self.element_type != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.element_type, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.data = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.element_type = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.data = ::buffa::bytes::Bytes::new();
self.element_type = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FeaturePrint {
const PROTO_FQN: &'static str = "media.v1.FeaturePrint";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for FeaturePrint {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __FEATURE_PRINT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.FeaturePrint",
to_json: ::buffa::type_registry::any_to_json::<FeaturePrint>,
from_json: ::buffa::type_registry::any_from_json::<FeaturePrint>,
is_wkt: false,
};
/// Either a video or an audio format.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct MediaKind {
#[cfg_attr(feature = "json", serde(flatten))]
pub kind: ::core::option::Option<__buffa::oneof::media_kind::Kind>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for MediaKind {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("MediaKind").field("kind", &self.kind).finish()
}
}
impl MediaKind {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.MediaKind";
}
impl ::buffa::DefaultInstance for MediaKind {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<MediaKind> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for MediaKind {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "MediaKind";
const FULL_NAME: &'static str = "media.v1.MediaKind";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.MediaKind";
}
impl ::buffa::Message for MediaKind {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.kind {
match v {
__buffa::oneof::media_kind::Kind::Video(x) => {
size += 1u32 + ::buffa::types::int32_encoded_len(x.to_i32()) as u32;
}
__buffa::oneof::media_kind::Kind::Audio(x) => {
size += 1u32 + ::buffa::types::int32_encoded_len(x.to_i32()) 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 let ::core::option::Option::Some(ref v) = self.kind {
match v {
__buffa::oneof::media_kind::Kind::Video(x) => {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_int32(x.to_i32(), buf);
}
__buffa::oneof::media_kind::Kind::Audio(x) => {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_int32(x.to_i32(), buf);
}
}
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.kind = ::core::option::Option::Some(
__buffa::oneof::media_kind::Kind::Video(
::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?),
),
);
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.kind = ::core::option::Option::Some(
__buffa::oneof::media_kind::Kind::Audio(
::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?),
),
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.kind = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for MediaKind {
const PROTO_FQN: &'static str = "media.v1.MediaKind";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl<'de> serde::Deserialize<'de> for MediaKind {
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 = MediaKind;
fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("struct MediaKind")
}
#[allow(clippy::field_reassign_with_default)]
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
mut map: A,
) -> ::core::result::Result<MediaKind, A::Error> {
let mut __oneof_kind: ::core::option::Option<
__buffa::oneof::media_kind::Kind,
> = None;
while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
match key.as_str() {
"video" => {
let v: ::core::option::Option<
::buffa::EnumValue<VideoFormat>,
> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
::buffa::EnumValue<VideoFormat>,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::media_kind::Kind::Video(v),
);
}
}
"audio" => {
let v: ::core::option::Option<
::buffa::EnumValue<AudioFormat>,
> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
::buffa::EnumValue<AudioFormat>,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::media_kind::Kind::Audio(v),
);
}
}
_ => {
map.next_value::<serde::de::IgnoredAny>()?;
}
}
}
let mut __r = <MediaKind as ::core::default::Default>::default();
__r.kind = __oneof_kind;
Ok(__r)
}
}
d.deserialize_map(_V)
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for MediaKind {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __MEDIA_KIND_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.MediaKind",
to_json: ::buffa::type_registry::any_to_json::<MediaKind>,
from_json: ::buffa::type_registry::any_from_json::<MediaKind>,
is_wkt: false,
};
pub mod media_kind {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::media_kind::Kind;
}
/// Detected document region as a quadrilateral (4 corners) + confidence.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct DocumentSegment {
/// Field 1: `top_left`
#[cfg_attr(
feature = "json",
serde(
rename = "topLeft",
alias = "top_left",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub top_left: ::buffa::MessageField<Point2D>,
/// Field 2: `top_right`
#[cfg_attr(
feature = "json",
serde(
rename = "topRight",
alias = "top_right",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub top_right: ::buffa::MessageField<Point2D>,
/// Field 3: `bottom_left`
#[cfg_attr(
feature = "json",
serde(
rename = "bottomLeft",
alias = "bottom_left",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bottom_left: ::buffa::MessageField<Point2D>,
/// Field 4: `bottom_right`
#[cfg_attr(
feature = "json",
serde(
rename = "bottomRight",
alias = "bottom_right",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bottom_right: ::buffa::MessageField<Point2D>,
/// Field 5: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for DocumentSegment {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("DocumentSegment")
.field("top_left", &self.top_left)
.field("top_right", &self.top_right)
.field("bottom_left", &self.bottom_left)
.field("bottom_right", &self.bottom_right)
.field("confidence", &self.confidence)
.finish()
}
}
impl DocumentSegment {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.DocumentSegment";
}
impl ::buffa::DefaultInstance for DocumentSegment {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<DocumentSegment> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for DocumentSegment {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "DocumentSegment";
const FULL_NAME: &'static str = "media.v1.DocumentSegment";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.DocumentSegment";
}
impl ::buffa::Message for DocumentSegment {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.top_left.is_set() {
let __slot = __cache.reserve();
let inner_size = self.top_left.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.top_right.is_set() {
let __slot = __cache.reserve();
let inner_size = self.top_right.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.bottom_left.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bottom_left.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.bottom_right.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bottom_right.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.top_left.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.top_left.write_to(__cache, buf);
}
if self.top_right.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.top_right.write_to(__cache, buf);
}
if self.bottom_left.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bottom_left.write_to(__cache, buf);
}
if self.bottom_right.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bottom_right.write_to(__cache, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.top_left.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.top_right.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bottom_left.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bottom_right.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.top_left = ::buffa::MessageField::none();
self.top_right = ::buffa::MessageField::none();
self.bottom_left = ::buffa::MessageField::none();
self.bottom_right = ::buffa::MessageField::none();
self.confidence = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for DocumentSegment {
const PROTO_FQN: &'static str = "media.v1.DocumentSegment";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for DocumentSegment {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __DOCUMENT_SEGMENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.DocumentSegment",
to_json: ::buffa::type_registry::any_to_json::<DocumentSegment>,
from_json: ::buffa::type_registry::any_from_json::<DocumentSegment>,
is_wkt: false,
};
/// Stable identifier (16-byte UUIDv7).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Id {
/// Field 1: `value`
#[cfg_attr(
feature = "json",
serde(
rename = "value",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub value: ::buffa::bytes::Bytes,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Id {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Id").field("value", &self.value).finish()
}
}
impl Id {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Id";
}
impl ::buffa::DefaultInstance for Id {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Id> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Id {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Id";
const FULL_NAME: &'static str = "media.v1.Id";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Id";
}
impl ::buffa::Message for Id {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.value.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.value) 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.value.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.value, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.value = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.value = ::buffa::bytes::Bytes::new();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Id {
const PROTO_FQN: &'static str = "media.v1.Id";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Id {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __ID_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Id",
to_json: ::buffa::type_registry::any_to_json::<Id>,
from_json: ::buffa::type_registry::any_from_json::<Id>,
is_wkt: false,
};
/// Content hash (32-byte blake3-256).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct FileChecksum {
/// Field 1: `value`
#[cfg_attr(
feature = "json",
serde(
rename = "value",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub value: ::buffa::bytes::Bytes,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FileChecksum {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FileChecksum").field("value", &self.value).finish()
}
}
impl FileChecksum {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FileChecksum";
}
impl ::buffa::DefaultInstance for FileChecksum {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FileChecksum> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for FileChecksum {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "FileChecksum";
const FULL_NAME: &'static str = "media.v1.FileChecksum";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FileChecksum";
}
impl ::buffa::Message for FileChecksum {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.value.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.value) 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.value.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.value, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.value = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.value = ::buffa::bytes::Bytes::new();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FileChecksum {
const PROTO_FQN: &'static str = "media.v1.FileChecksum";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for FileChecksum {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __FILE_CHECKSUM_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.FileChecksum",
to_json: ::buffa::type_registry::any_to_json::<FileChecksum>,
from_json: ::buffa::type_registry::any_from_json::<FileChecksum>,
is_wkt: false,
};
/// A path on a local volume: volume Id + path components.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Local {
/// Field 1: `volume`
#[cfg_attr(
feature = "json",
serde(
rename = "volume",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub volume: ::buffa::MessageField<Id>,
/// Field 2: `components`
#[cfg_attr(
feature = "json",
serde(
rename = "components",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub components: ::buffa::alloc::vec::Vec<::buffa::smol_str::SmolStr>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Local {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Local")
.field("volume", &self.volume)
.field("components", &self.components)
.finish()
}
}
impl Local {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Local";
}
impl ::buffa::DefaultInstance for Local {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Local> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Local {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Local";
const FULL_NAME: &'static str = "media.v1.Local";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Local";
}
impl ::buffa::Message for Local {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.volume.is_set() {
let __slot = __cache.reserve();
let inner_size = self.volume.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.components {
size += 1u32 + ::buffa::types::string_encoded_len(v) 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.volume.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.volume.write_to(__cache, buf);
}
for v in &self.components {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.volume.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.components.push(::buffa::types::decode_string_to(buf)?);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.volume = ::buffa::MessageField::none();
self.components.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Local {
const PROTO_FQN: &'static str = "media.v1.Local";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Local {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LOCAL_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Local",
to_json: ::buffa::type_registry::any_to_json::<Local>,
from_json: ::buffa::type_registry::any_from_json::<Local>,
is_wkt: false,
};
/// A resolved storage location.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Location {
#[cfg_attr(feature = "json", serde(flatten))]
pub kind: ::core::option::Option<__buffa::oneof::location::Kind>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Location {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Location").field("kind", &self.kind).finish()
}
}
impl Location {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Location";
}
impl ::buffa::DefaultInstance for Location {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Location> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Location {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Location";
const FULL_NAME: &'static str = "media.v1.Location";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Location";
}
impl ::buffa::Message for Location {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.kind {
match v {
__buffa::oneof::location::Kind::Local(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.kind {
match v {
__buffa::oneof::location::Kind::Local(x) => {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::location::Kind::Local(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::location::Kind::Local(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.kind = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Location {
const PROTO_FQN: &'static str = "media.v1.Location";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl<'de> serde::Deserialize<'de> for Location {
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 = Location;
fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("struct Location")
}
#[allow(clippy::field_reassign_with_default)]
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
mut map: A,
) -> ::core::result::Result<Location, A::Error> {
let mut __oneof_kind: ::core::option::Option<
__buffa::oneof::location::Kind,
> = None;
while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
match key.as_str() {
"local" => {
let v: ::core::option::Option<Local> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
Local,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::location::Kind::Local(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
_ => {
map.next_value::<serde::de::IgnoredAny>()?;
}
}
}
let mut __r = <Location as ::core::default::Default>::default();
__r.kind = __oneof_kind;
Ok(__r)
}
}
d.deserialize_map(_V)
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Location {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LOCATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Location",
to_json: ::buffa::type_registry::any_to_json::<Location>,
from_json: ::buffa::type_registry::any_from_json::<Location>,
is_wkt: false,
};
pub mod location {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::location::Kind;
}
/// An unresolved storage target (pre-volume-resolution).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct LocationTarget {
#[cfg_attr(feature = "json", serde(flatten))]
pub kind: ::core::option::Option<__buffa::oneof::location_target::Kind>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for LocationTarget {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("LocationTarget").field("kind", &self.kind).finish()
}
}
impl LocationTarget {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LocationTarget";
}
impl ::buffa::DefaultInstance for LocationTarget {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<LocationTarget> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for LocationTarget {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "LocationTarget";
const FULL_NAME: &'static str = "media.v1.LocationTarget";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LocationTarget";
}
impl ::buffa::Message for LocationTarget {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.kind {
match v {
__buffa::oneof::location_target::Kind::Local(x) => {
size += 1u32 + ::buffa::types::string_encoded_len(x) 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 let ::core::option::Option::Some(ref v) = self.kind {
match v {
__buffa::oneof::location_target::Kind::Local(x) => {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(x, buf);
}
}
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.kind = ::core::option::Option::Some(
__buffa::oneof::location_target::Kind::Local(
::buffa::types::decode_string_to(buf)?,
),
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.kind = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for LocationTarget {
const PROTO_FQN: &'static str = "media.v1.LocationTarget";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl<'de> serde::Deserialize<'de> for LocationTarget {
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 = LocationTarget;
fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("struct LocationTarget")
}
#[allow(clippy::field_reassign_with_default)]
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
mut map: A,
) -> ::core::result::Result<LocationTarget, A::Error> {
let mut __oneof_kind: ::core::option::Option<
__buffa::oneof::location_target::Kind,
> = None;
while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
match key.as_str() {
"local" => {
let v: ::core::option::Option<::buffa::smol_str::SmolStr> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
::buffa::smol_str::SmolStr,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::location_target::Kind::Local(v),
);
}
}
_ => {
map.next_value::<serde::de::IgnoredAny>()?;
}
}
}
let mut __r = <LocationTarget as ::core::default::Default>::default();
__r.kind = __oneof_kind;
Ok(__r)
}
}
d.deserialize_map(_V)
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for LocationTarget {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LOCATION_TARGET_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.LocationTarget",
to_json: ::buffa::type_registry::any_to_json::<LocationTarget>,
from_json: ::buffa::type_registry::any_from_json::<LocationTarget>,
is_wkt: false,
};
pub mod location_target {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::location_target::Kind;
}
/// A content-addressed path: checksum + location.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AppPathBuf {
/// Field 1: `checksum`
#[cfg_attr(
feature = "json",
serde(
rename = "checksum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub checksum: ::buffa::MessageField<FileChecksum>,
/// Field 2: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AppPathBuf {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AppPathBuf")
.field("checksum", &self.checksum)
.field("location", &self.location)
.finish()
}
}
impl AppPathBuf {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AppPathBuf";
}
impl ::buffa::DefaultInstance for AppPathBuf {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AppPathBuf> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AppPathBuf {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AppPathBuf";
const FULL_NAME: &'static str = "media.v1.AppPathBuf";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AppPathBuf";
}
impl ::buffa::Message for AppPathBuf {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.checksum.is_set() {
let __slot = __cache.reserve();
let inner_size = self.checksum.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.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.checksum.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.checksum.write_to(__cache, buf);
}
if self.location.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.checksum.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.checksum = ::buffa::MessageField::none();
self.location = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AppPathBuf {
const PROTO_FQN: &'static str = "media.v1.AppPathBuf";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AppPathBuf {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __APP_PATH_BUF_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AppPathBuf",
to_json: ::buffa::type_registry::any_to_json::<AppPathBuf>,
from_json: ::buffa::type_registry::any_from_json::<AppPathBuf>,
is_wkt: false,
};
/// A user tag: name + packed RGBA color.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Tag {
/// Field 1: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 2: `color`
#[cfg_attr(
feature = "json",
serde(
rename = "color",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub color: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Tag {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Tag")
.field("name", &self.name)
.field("color", &self.color)
.finish()
}
}
impl Tag {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Tag";
}
impl ::buffa::DefaultInstance for Tag {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Tag> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Tag {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Tag";
const FULL_NAME: &'static str = "media.v1.Tag";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Tag";
}
impl ::buffa::Message for Tag {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.color != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.color != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_fixed32(self.color, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.color = ::buffa::types::decode_fixed32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::default::Default::default();
self.color = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Tag {
const PROTO_FQN: &'static str = "media.v1.Tag";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Tag {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TAG_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Tag",
to_json: ::buffa::type_registry::any_to_json::<Tag>,
from_json: ::buffa::type_registry::any_from_json::<Tag>,
is_wkt: false,
};
/// A structured error: numeric code + message.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ErrorInfo {
/// Field 1: `code`
#[cfg_attr(
feature = "json",
serde(
rename = "code",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub code: u32,
/// Field 2: `message`
#[cfg_attr(
feature = "json",
serde(
rename = "message",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub message: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ErrorInfo {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ErrorInfo")
.field("code", &self.code)
.field("message", &self.message)
.finish()
}
}
impl ErrorInfo {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ErrorInfo";
}
impl ::buffa::DefaultInstance for ErrorInfo {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ErrorInfo> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ErrorInfo {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ErrorInfo";
const FULL_NAME: &'static str = "media.v1.ErrorInfo";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ErrorInfo";
}
impl ::buffa::Message for ErrorInfo {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.code != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.code) as u32;
}
if !self.message.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.message) 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.code != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.code, buf);
}
if !self.message.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.message, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.code = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.message = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.code = 0u32;
self.message = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ErrorInfo {
const PROTO_FQN: &'static str = "media.v1.ErrorInfo";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ErrorInfo {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __ERROR_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ErrorInfo",
to_json: ::buffa::type_registry::any_to_json::<ErrorInfo>,
from_json: ::buffa::type_registry::any_from_json::<ErrorInfo>,
is_wkt: false,
};
/// Analysis-run reproducibility — which model / prompt / indexer produced
/// this analysis record, so a re-run on upgrade is deterministic. Locked
/// shared cross-cutting VO (see `schema/README.md`). Carried by every
/// analysis record that needs to record its production model + version;
/// empty (all-`""`) is the canonical "not yet recorded" state.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Provenance {
/// Field 1: `model_name`
#[cfg_attr(
feature = "json",
serde(
rename = "modelName",
alias = "model_name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub model_name: ::buffa::smol_str::SmolStr,
/// Field 2: `model_version`
#[cfg_attr(
feature = "json",
serde(
rename = "modelVersion",
alias = "model_version",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub model_version: ::buffa::smol_str::SmolStr,
/// Field 3: `prompt_version`
#[cfg_attr(
feature = "json",
serde(
rename = "promptVersion",
alias = "prompt_version",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub prompt_version: ::buffa::smol_str::SmolStr,
/// Field 4: `indexer_version`
#[cfg_attr(
feature = "json",
serde(
rename = "indexerVersion",
alias = "indexer_version",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub indexer_version: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Provenance {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Provenance")
.field("model_name", &self.model_name)
.field("model_version", &self.model_version)
.field("prompt_version", &self.prompt_version)
.field("indexer_version", &self.indexer_version)
.finish()
}
}
impl Provenance {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Provenance";
}
impl ::buffa::DefaultInstance for Provenance {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Provenance> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Provenance {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Provenance";
const FULL_NAME: &'static str = "media.v1.Provenance";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Provenance";
}
impl ::buffa::Message for Provenance {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.model_name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.model_name) as u32;
}
if !self.model_version.is_empty() {
size
+= 1u32 + ::buffa::types::string_encoded_len(&self.model_version) as u32;
}
if !self.prompt_version.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.prompt_version) as u32;
}
if !self.indexer_version.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.indexer_version) 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.model_name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.model_name, buf);
}
if !self.model_version.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.model_version, buf);
}
if !self.prompt_version.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.prompt_version, buf);
}
if !self.indexer_version.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.indexer_version, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.model_name = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.model_version = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.prompt_version = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.indexer_version = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.model_name = ::core::default::Default::default();
self.model_version = ::core::default::Default::default();
self.prompt_version = ::core::default::Default::default();
self.indexer_version = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Provenance {
const PROTO_FQN: &'static str = "media.v1.Provenance";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Provenance {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __PROVENANCE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Provenance",
to_json: ::buffa::type_registry::any_to_json::<Provenance>,
from_json: ::buffa::type_registry::any_from_json::<Provenance>,
is_wkt: false,
};
/// Voice-embedding metadata. The actual vector lives in an external
/// vector store (LanceDB / Qdrant / Milvus / pgvector / …); this message
/// is the linkage + provenance kept in the wire model. Vendor-neutral:
/// `vector_id` is opaque to the wire contract.
///
/// Embedded into `Person.voiceprint` as `optional VoiceFingerprint`, and
/// (once their wire messages land) into `Speaker.voiceprint` and
/// `AudioSegment.voice_fingerprint`.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VoiceFingerprint {
/// Field 1: `vector_id`
#[cfg_attr(
feature = "json",
serde(
rename = "vectorId",
alias = "vector_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub vector_id: ::buffa::bytes::Bytes,
/// Field 2: `dimensions`
#[cfg_attr(
feature = "json",
serde(
rename = "dimensions",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub dimensions: u32,
/// ms since Unix epoch.
///
/// Field 3: `extracted_at`
#[cfg_attr(
feature = "json",
serde(
rename = "extractedAt",
alias = "extracted_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub extracted_at: i64,
/// `optional` so "model did not expose a confidence" distinguishes from
/// a real 0.0.
///
/// Field 4: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::opt_float",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub confidence: ::core::option::Option<f32>,
/// Field 5: `provenance`
#[cfg_attr(
feature = "json",
serde(
rename = "provenance",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub provenance: ::buffa::MessageField<Provenance>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VoiceFingerprint {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VoiceFingerprint")
.field("vector_id", &self.vector_id)
.field("dimensions", &self.dimensions)
.field("extracted_at", &self.extracted_at)
.field("confidence", &self.confidence)
.field("provenance", &self.provenance)
.finish()
}
}
impl VoiceFingerprint {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VoiceFingerprint";
}
impl VoiceFingerprint {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::confidence`] to `Some(value)`, consuming and returning `self`.
pub fn with_confidence(mut self, value: f32) -> Self {
self.confidence = Some(value);
self
}
}
impl ::buffa::DefaultInstance for VoiceFingerprint {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VoiceFingerprint> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VoiceFingerprint {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VoiceFingerprint";
const FULL_NAME: &'static str = "media.v1.VoiceFingerprint";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VoiceFingerprint";
}
impl ::buffa::Message for VoiceFingerprint {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.vector_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.vector_id) as u32;
}
if self.dimensions != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.dimensions) as u32;
}
if self.extracted_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.extracted_at) as u32;
}
if self.confidence.is_some() {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.provenance.is_set() {
let __slot = __cache.reserve();
let inner_size = self.provenance.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.vector_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.vector_id, buf);
}
if self.dimensions != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.dimensions, buf);
}
if self.extracted_at != 0i64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.extracted_at, buf);
}
if let Some(v) = self.confidence {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(v, buf);
}
if self.provenance.is_set() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.provenance.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.vector_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.dimensions = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.extracted_at = ::buffa::types::decode_int64(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::core::option::Option::Some(
::buffa::types::decode_float(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.provenance.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.vector_id = ::buffa::bytes::Bytes::new();
self.dimensions = 0u32;
self.extracted_at = 0i64;
self.confidence = ::core::option::Option::None;
self.provenance = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VoiceFingerprint {
const PROTO_FQN: &'static str = "media.v1.VoiceFingerprint";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VoiceFingerprint {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VOICE_FINGERPRINT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VoiceFingerprint",
to_json: ::buffa::type_registry::any_to_json::<VoiceFingerprint>,
from_json: ::buffa::type_registry::any_from_json::<VoiceFingerprint>,
is_wkt: false,
};
/// Cross-track / cross-modality identity anchor. One `Person` ↔ many
/// `Speaker`s (one per track they appear in). Modality-neutral so a
/// future face-side identity can hang off the same aggregate.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Person {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// "" = unnamed
///
/// Field 2: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 3: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub confidence: ::buffa::EnumValue<PersonConfidence>,
/// Field 4: `voiceprint`
#[cfg_attr(
feature = "json",
serde(
rename = "voiceprint",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub voiceprint: ::buffa::MessageField<VoiceFingerprint>,
/// ms since Unix epoch.
///
/// Field 5: `created_at`
#[cfg_attr(
feature = "json",
serde(
rename = "createdAt",
alias = "created_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub created_at: i64,
/// ms since Unix epoch.
///
/// Field 6: `updated_at`
#[cfg_attr(
feature = "json",
serde(
rename = "updatedAt",
alias = "updated_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub updated_at: i64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Person {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Person")
.field("id", &self.id)
.field("name", &self.name)
.field("confidence", &self.confidence)
.field("voiceprint", &self.voiceprint)
.field("created_at", &self.created_at)
.field("updated_at", &self.updated_at)
.finish()
}
}
impl Person {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Person";
}
impl ::buffa::DefaultInstance for Person {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Person> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Person {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Person";
const FULL_NAME: &'static str = "media.v1.Person";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Person";
}
impl ::buffa::Message for Person {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
{
let val = self.confidence.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.voiceprint.is_set() {
let __slot = __cache.reserve();
let inner_size = self.voiceprint.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.created_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.created_at) as u32;
}
if self.updated_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.updated_at) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
{
let val = self.confidence.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.voiceprint.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.voiceprint.write_to(__cache, buf);
}
if self.created_at != 0i64 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.created_at, buf);
}
if self.updated_at != 0i64 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.updated_at, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.voiceprint.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.created_at = ::buffa::types::decode_int64(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.updated_at = ::buffa::types::decode_int64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.name = ::core::default::Default::default();
self.confidence = ::buffa::EnumValue::from(0);
self.voiceprint = ::buffa::MessageField::none();
self.created_at = 0i64;
self.updated_at = 0i64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Person {
const PROTO_FQN: &'static str = "media.v1.Person";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Person {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __PERSON_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Person",
to_json: ::buffa::type_registry::any_to_json::<Person>,
from_json: ::buffa::type_registry::any_from_json::<Person>,
is_wkt: false,
};
/// Source / translated string pair. "" = absent (empty-string sentinel),
/// not Null — matches the SmolStr empty-means-absent domain convention.
/// Locked shared cross-cutting VO (see `schema/README.md`); embedded in
/// `AudioSegment.text` (and future VLM-narrative parents).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct LocalizedText {
/// Field 1: `src`
#[cfg_attr(
feature = "json",
serde(
rename = "src",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub src: ::buffa::smol_str::SmolStr,
/// Field 2: `translated`
#[cfg_attr(
feature = "json",
serde(
rename = "translated",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub translated: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for LocalizedText {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("LocalizedText")
.field("src", &self.src)
.field("translated", &self.translated)
.finish()
}
}
impl LocalizedText {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LocalizedText";
}
impl ::buffa::DefaultInstance for LocalizedText {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<LocalizedText> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for LocalizedText {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "LocalizedText";
const FULL_NAME: &'static str = "media.v1.LocalizedText";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LocalizedText";
}
impl ::buffa::Message for LocalizedText {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.src.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.src) as u32;
}
if !self.translated.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.translated) 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.src.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.src, buf);
}
if !self.translated.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.translated, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.src = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.translated = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.src = ::core::default::Default::default();
self.translated = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for LocalizedText {
const PROTO_FQN: &'static str = "media.v1.LocalizedText";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for LocalizedText {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LOCALIZED_TEXT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.LocalizedText",
to_json: ::buffa::type_registry::any_to_json::<LocalizedText>,
from_json: ::buffa::type_registry::any_from_json::<LocalizedText>,
is_wkt: false,
};
/// BCP-47 language tag wrapper (mediaframe `lang::Language`). "" or "und"
/// = unspecified; the wire form is the smallest round-trip surface
/// (`Language::from_bcp47` / `to_bcp47`).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Language {
/// Field 1: `bcp47`
#[cfg_attr(
feature = "json",
serde(
rename = "bcp47",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub bcp47: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Language {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Language").field("bcp47", &self.bcp47).finish()
}
}
impl Language {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Language";
}
impl ::buffa::DefaultInstance for Language {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Language> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Language {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Language";
const FULL_NAME: &'static str = "media.v1.Language";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Language";
}
impl ::buffa::Message for Language {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.bcp47.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.bcp47) 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.bcp47.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.bcp47, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.bcp47 = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.bcp47 = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Language {
const PROTO_FQN: &'static str = "media.v1.Language";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Language {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LANGUAGE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Language",
to_json: ::buffa::type_registry::any_to_json::<Language>,
from_json: ::buffa::type_registry::any_from_json::<Language>,
is_wkt: false,
};
/// Word-level timing + score (`asry` output; producer-agnostic). `score`
/// is `[0,1]` and always present (NaN-free per locked spec); per-word
/// `language` carries code-switch / multilingual cues — `None` =
/// inherits the segment language.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Word {
/// Field 1: `text`
#[cfg_attr(
feature = "json",
serde(
rename = "text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub text: ::buffa::smol_str::SmolStr,
/// Field 2: `span`
#[cfg_attr(
feature = "json",
serde(
rename = "span",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub span: ::buffa::MessageField<::mediatime::TimeRange>,
/// Field 3: `score`
#[cfg_attr(
feature = "json",
serde(
rename = "score",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub score: f32,
/// Field 4: `language`
#[cfg_attr(
feature = "json",
serde(
rename = "language",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub language: ::buffa::MessageField<Language>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Word {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Word")
.field("text", &self.text)
.field("span", &self.span)
.field("score", &self.score)
.field("language", &self.language)
.finish()
}
}
impl Word {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Word";
}
impl ::buffa::DefaultInstance for Word {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Word> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Word {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Word";
const FULL_NAME: &'static str = "media.v1.Word";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Word";
}
impl ::buffa::Message for Word {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.text) as u32;
}
if self.span.is_set() {
let __slot = __cache.reserve();
let inner_size = self.span.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.score.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.language.is_set() {
let __slot = __cache.reserve();
let inner_size = self.language.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.text.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.text, buf);
}
if self.span.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.span.write_to(__cache, buf);
}
if self.score.to_bits() != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.score, buf);
}
if self.language.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.language.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.text = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.span.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.score = ::buffa::types::decode_float(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.language.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.text = ::core::default::Default::default();
self.span = ::buffa::MessageField::none();
self.score = 0f32;
self.language = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Word {
const PROTO_FQN: &'static str = "media.v1.Word";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Word {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __WORD_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Word",
to_json: ::buffa::type_registry::any_to_json::<Word>,
from_json: ::buffa::type_registry::any_from_json::<Word>,
is_wkt: false,
};
/// Per-track diarized speaker (locked `schema/speaker.md`). `audio_track_id`
/// references the `AudioTrack.id`. `person_id` (when set) references the
/// `Person.id` — cross-track identity. `voiceprint` is the per-track
/// aggregated centroid (per-segment fingerprints live on
/// `AudioSegment.voice_fingerprint`).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Speaker {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `audio_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "audioTrackId",
alias = "audio_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub audio_track_id: ::buffa::bytes::Bytes,
/// Field 3: `cluster_id`
#[cfg_attr(
feature = "json",
serde(
rename = "clusterId",
alias = "cluster_id",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub cluster_id: u32,
/// Field 4: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 5: `speech_duration`
#[cfg_attr(
feature = "json",
serde(
rename = "speechDuration",
alias = "speech_duration",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub speech_duration: ::buffa::MessageField<::mediatime::Timestamp>,
/// Field 6: `voiceprint`
#[cfg_attr(
feature = "json",
serde(
rename = "voiceprint",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub voiceprint: ::buffa::MessageField<VoiceFingerprint>,
/// Field 7: `person_id`
#[cfg_attr(
feature = "json",
serde(
rename = "personId",
alias = "person_id",
with = "::buffa::json_helpers::opt_bytes",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_opt)
)]
pub person_id: ::core::option::Option<::buffa::bytes::Bytes>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Speaker {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Speaker")
.field("id", &self.id)
.field("audio_track_id", &self.audio_track_id)
.field("cluster_id", &self.cluster_id)
.field("name", &self.name)
.field("speech_duration", &self.speech_duration)
.field("voiceprint", &self.voiceprint)
.field("person_id", &self.person_id)
.finish()
}
}
impl Speaker {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Speaker";
}
impl Speaker {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::person_id`] to `Some(value)`, consuming and returning `self`.
pub fn with_person_id(mut self, value: impl Into<::buffa::bytes::Bytes>) -> Self {
self.person_id = Some(value.into());
self
}
}
impl ::buffa::DefaultInstance for Speaker {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Speaker> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Speaker {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Speaker";
const FULL_NAME: &'static str = "media.v1.Speaker";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Speaker";
}
impl ::buffa::Message for Speaker {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.audio_track_id.is_empty() {
size
+= 1u32 + ::buffa::types::bytes_encoded_len(&self.audio_track_id) as u32;
}
if self.cluster_id != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.cluster_id) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if self.speech_duration.is_set() {
let __slot = __cache.reserve();
let inner_size = self.speech_duration.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.voiceprint.is_set() {
let __slot = __cache.reserve();
let inner_size = self.voiceprint.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if let Some(ref v) = self.person_id {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.audio_track_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.audio_track_id, buf);
}
if self.cluster_id != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.cluster_id, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.speech_duration.is_set() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.speech_duration.write_to(__cache, buf);
}
if self.voiceprint.is_set() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.voiceprint.write_to(__cache, buf);
}
if let Some(ref v) = self.person_id {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.audio_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.cluster_id = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.speech_duration.get_or_insert_default(),
buf,
depth,
)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.voiceprint.get_or_insert_default(),
buf,
depth,
)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.person_id = ::core::option::Option::Some(
::buffa::types::decode_bytes_to_bytes(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.audio_track_id = ::buffa::bytes::Bytes::new();
self.cluster_id = 0u32;
self.name = ::core::default::Default::default();
self.speech_duration = ::buffa::MessageField::none();
self.voiceprint = ::buffa::MessageField::none();
self.person_id = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Speaker {
const PROTO_FQN: &'static str = "media.v1.Speaker";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Speaker {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SPEAKER_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Speaker",
to_json: ::buffa::type_registry::any_to_json::<Speaker>,
from_json: ::buffa::type_registry::any_from_json::<Speaker>,
is_wkt: false,
};
/// One reconciled `dia ⋈ asry` speak range of an `AudioTrack` (locked
/// `schema/audio_segments.md`). `audio_track_id` references the
/// `AudioTrack.id`. `speaker_id` (when set) references a `Speaker.id`.
/// `voice_fingerprint` is the per-segment embedding (aggregates upward
/// into `Speaker.voiceprint`).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioSegment {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `audio_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "audioTrackId",
alias = "audio_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub audio_track_id: ::buffa::bytes::Bytes,
/// Field 3: `index`
#[cfg_attr(
feature = "json",
serde(
rename = "index",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub index: u32,
/// Field 4: `span`
#[cfg_attr(
feature = "json",
serde(
rename = "span",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub span: ::buffa::MessageField<::mediatime::TimeRange>,
/// Field 5: `speaker_id`
#[cfg_attr(
feature = "json",
serde(
rename = "speakerId",
alias = "speaker_id",
with = "::buffa::json_helpers::opt_bytes",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_opt)
)]
pub speaker_id: ::core::option::Option<::buffa::bytes::Bytes>,
/// Field 6: `text`
#[cfg_attr(
feature = "json",
serde(
rename = "text",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub text: ::buffa::MessageField<LocalizedText>,
/// Field 7: `language`
#[cfg_attr(
feature = "json",
serde(
rename = "language",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub language: ::buffa::MessageField<Language>,
/// Field 8: `words`
#[cfg_attr(
feature = "json",
serde(
rename = "words",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub words: ::buffa::alloc::vec::Vec<Word>,
/// Field 9: `no_speech_prob`
#[cfg_attr(
feature = "json",
serde(
rename = "noSpeechProb",
alias = "no_speech_prob",
with = "::buffa::json_helpers::opt_float",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub no_speech_prob: ::core::option::Option<f32>,
/// Field 10: `avg_logprob`
#[cfg_attr(
feature = "json",
serde(
rename = "avgLogprob",
alias = "avg_logprob",
with = "::buffa::json_helpers::opt_float",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub avg_logprob: ::core::option::Option<f32>,
/// Field 11: `temperature`
#[cfg_attr(
feature = "json",
serde(
rename = "temperature",
with = "::buffa::json_helpers::opt_float",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub temperature: ::core::option::Option<f32>,
/// Field 12: `voice_fingerprint`
#[cfg_attr(
feature = "json",
serde(
rename = "voiceFingerprint",
alias = "voice_fingerprint",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub voice_fingerprint: ::buffa::MessageField<VoiceFingerprint>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioSegment {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioSegment")
.field("id", &self.id)
.field("audio_track_id", &self.audio_track_id)
.field("index", &self.index)
.field("span", &self.span)
.field("speaker_id", &self.speaker_id)
.field("text", &self.text)
.field("language", &self.language)
.field("words", &self.words)
.field("no_speech_prob", &self.no_speech_prob)
.field("avg_logprob", &self.avg_logprob)
.field("temperature", &self.temperature)
.field("voice_fingerprint", &self.voice_fingerprint)
.finish()
}
}
impl AudioSegment {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioSegment";
}
impl AudioSegment {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::speaker_id`] to `Some(value)`, consuming and returning `self`.
pub fn with_speaker_id(mut self, value: impl Into<::buffa::bytes::Bytes>) -> Self {
self.speaker_id = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::no_speech_prob`] to `Some(value)`, consuming and returning `self`.
pub fn with_no_speech_prob(mut self, value: f32) -> Self {
self.no_speech_prob = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::avg_logprob`] to `Some(value)`, consuming and returning `self`.
pub fn with_avg_logprob(mut self, value: f32) -> Self {
self.avg_logprob = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::temperature`] to `Some(value)`, consuming and returning `self`.
pub fn with_temperature(mut self, value: f32) -> Self {
self.temperature = Some(value);
self
}
}
impl ::buffa::DefaultInstance for AudioSegment {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioSegment> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioSegment {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioSegment";
const FULL_NAME: &'static str = "media.v1.AudioSegment";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioSegment";
}
impl ::buffa::Message for AudioSegment {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.audio_track_id.is_empty() {
size
+= 1u32 + ::buffa::types::bytes_encoded_len(&self.audio_track_id) as u32;
}
if self.index != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.index) as u32;
}
if self.span.is_set() {
let __slot = __cache.reserve();
let inner_size = self.span.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if let Some(ref v) = self.speaker_id {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
if self.text.is_set() {
let __slot = __cache.reserve();
let inner_size = self.text.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.language.is_set() {
let __slot = __cache.reserve();
let inner_size = self.language.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.words {
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;
}
if self.no_speech_prob.is_some() {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.avg_logprob.is_some() {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.temperature.is_some() {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.voice_fingerprint.is_set() {
let __slot = __cache.reserve();
let inner_size = self.voice_fingerprint.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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.audio_track_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.audio_track_id, buf);
}
if self.index != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.index, buf);
}
if self.span.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.span.write_to(__cache, buf);
}
if let Some(ref v) = self.speaker_id {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
if self.text.is_set() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.text.write_to(__cache, buf);
}
if self.language.is_set() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.language.write_to(__cache, buf);
}
for v in &self.words {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if let Some(v) = self.no_speech_prob {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(v, buf);
}
if let Some(v) = self.avg_logprob {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(v, buf);
}
if let Some(v) = self.temperature {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(v, buf);
}
if self.voice_fingerprint.is_set() {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.voice_fingerprint.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.audio_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.index = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.span.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.speaker_id = ::core::option::Option::Some(
::buffa::types::decode_bytes_to_bytes(buf)?,
);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.text.get_or_insert_default(),
buf,
depth,
)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.language.get_or_insert_default(),
buf,
depth,
)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.words.push(elem);
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.no_speech_prob = ::core::option::Option::Some(
::buffa::types::decode_float(buf)?,
);
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.avg_logprob = ::core::option::Option::Some(
::buffa::types::decode_float(buf)?,
);
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.temperature = ::core::option::Option::Some(
::buffa::types::decode_float(buf)?,
);
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.voice_fingerprint.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.audio_track_id = ::buffa::bytes::Bytes::new();
self.index = 0u32;
self.span = ::buffa::MessageField::none();
self.speaker_id = ::core::option::Option::None;
self.text = ::buffa::MessageField::none();
self.language = ::buffa::MessageField::none();
self.words.clear();
self.no_speech_prob = ::core::option::Option::None;
self.avg_logprob = ::core::option::Option::None;
self.temperature = ::core::option::Option::None;
self.voice_fingerprint = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioSegment {
const PROTO_FQN: &'static str = "media.v1.AudioSegment";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioSegment {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_SEGMENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioSegment",
to_json: ::buffa::type_registry::any_to_json::<AudioSegment>,
from_json: ::buffa::type_registry::any_from_json::<AudioSegment>,
is_wkt: false,
};
/// A watched media location with indexing progress counters.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct WatchedLocation {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub id: ::buffa::MessageField<Id>,
/// Field 2: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
/// Field 3: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// LocationStatus bitflags (ACTIVE=1, TOMBSTONED=2)
///
/// Field 4: `status`
#[cfg_attr(
feature = "json",
serde(
rename = "status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub status: u32,
/// Field 5: `created_at`
#[cfg_attr(
feature = "json",
serde(
rename = "createdAt",
alias = "created_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub created_at: i64,
/// Field 6: `deleted_at`
#[cfg_attr(
feature = "json",
serde(
rename = "deletedAt",
alias = "deleted_at",
with = "::buffa::json_helpers::opt_int64",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub deleted_at: ::core::option::Option<i64>,
/// Field 7: `total_files`
#[cfg_attr(
feature = "json",
serde(
rename = "totalFiles",
alias = "total_files",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_files: u64,
/// Field 8: `indexed_files`
#[cfg_attr(
feature = "json",
serde(
rename = "indexedFiles",
alias = "indexed_files",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub indexed_files: u64,
/// Field 9: `total_videos`
#[cfg_attr(
feature = "json",
serde(
rename = "totalVideos",
alias = "total_videos",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_videos: u64,
/// Field 10: `indexed_videos`
#[cfg_attr(
feature = "json",
serde(
rename = "indexedVideos",
alias = "indexed_videos",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub indexed_videos: u64,
/// Field 11: `total_scenes`
#[cfg_attr(
feature = "json",
serde(
rename = "totalScenes",
alias = "total_scenes",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_scenes: u64,
/// Field 12: `total_audios`
#[cfg_attr(
feature = "json",
serde(
rename = "totalAudios",
alias = "total_audios",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_audios: u64,
/// Field 13: `indexed_audios`
#[cfg_attr(
feature = "json",
serde(
rename = "indexedAudios",
alias = "indexed_audios",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub indexed_audios: u64,
/// Field 14: `total_failed_files`
#[cfg_attr(
feature = "json",
serde(
rename = "totalFailedFiles",
alias = "total_failed_files",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_failed_files: u64,
/// Field 15: `failed_videos`
#[cfg_attr(
feature = "json",
serde(
rename = "failedVideos",
alias = "failed_videos",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub failed_videos: u64,
/// Field 16: `failed_audios`
#[cfg_attr(
feature = "json",
serde(
rename = "failedAudios",
alias = "failed_audios",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub failed_audios: u64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for WatchedLocation {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("WatchedLocation")
.field("id", &self.id)
.field("location", &self.location)
.field("name", &self.name)
.field("status", &self.status)
.field("created_at", &self.created_at)
.field("deleted_at", &self.deleted_at)
.field("total_files", &self.total_files)
.field("indexed_files", &self.indexed_files)
.field("total_videos", &self.total_videos)
.field("indexed_videos", &self.indexed_videos)
.field("total_scenes", &self.total_scenes)
.field("total_audios", &self.total_audios)
.field("indexed_audios", &self.indexed_audios)
.field("total_failed_files", &self.total_failed_files)
.field("failed_videos", &self.failed_videos)
.field("failed_audios", &self.failed_audios)
.finish()
}
}
impl WatchedLocation {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.WatchedLocation";
}
impl WatchedLocation {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::deleted_at`] to `Some(value)`, consuming and returning `self`.
pub fn with_deleted_at(mut self, value: i64) -> Self {
self.deleted_at = Some(value);
self
}
}
impl ::buffa::DefaultInstance for WatchedLocation {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<WatchedLocation> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for WatchedLocation {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "WatchedLocation";
const FULL_NAME: &'static str = "media.v1.WatchedLocation";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.WatchedLocation";
}
impl ::buffa::Message for WatchedLocation {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_set() {
let __slot = __cache.reserve();
let inner_size = self.id.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if self.status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.status) as u32;
}
if self.created_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.created_at) as u32;
}
if let Some(v) = self.deleted_at {
size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
}
if self.total_files != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_files) as u32;
}
if self.indexed_files != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.indexed_files) as u32;
}
if self.total_videos != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_videos) as u32;
}
if self.indexed_videos != 0u64 {
size
+= 1u32 + ::buffa::types::uint64_encoded_len(self.indexed_videos) as u32;
}
if self.total_scenes != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_scenes) as u32;
}
if self.total_audios != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_audios) as u32;
}
if self.indexed_audios != 0u64 {
size
+= 1u32 + ::buffa::types::uint64_encoded_len(self.indexed_audios) as u32;
}
if self.total_failed_files != 0u64 {
size
+= 1u32
+ ::buffa::types::uint64_encoded_len(self.total_failed_files) as u32;
}
if self.failed_videos != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.failed_videos) as u32;
}
if self.failed_audios != 0u64 {
size += 2u32 + ::buffa::types::uint64_encoded_len(self.failed_audios) 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.id.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.id.write_to(__cache, buf);
}
if self.location.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.write_to(__cache, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.status != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.status, buf);
}
if self.created_at != 0i64 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.created_at, buf);
}
if let Some(v) = self.deleted_at {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(v, buf);
}
if self.total_files != 0u64 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_files, buf);
}
if self.indexed_files != 0u64 {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.indexed_files, buf);
}
if self.total_videos != 0u64 {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_videos, buf);
}
if self.indexed_videos != 0u64 {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.indexed_videos, buf);
}
if self.total_scenes != 0u64 {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_scenes, buf);
}
if self.total_audios != 0u64 {
::buffa::encoding::Tag::new(12u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_audios, buf);
}
if self.indexed_audios != 0u64 {
::buffa::encoding::Tag::new(13u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.indexed_audios, buf);
}
if self.total_failed_files != 0u64 {
::buffa::encoding::Tag::new(14u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_failed_files, buf);
}
if self.failed_videos != 0u64 {
::buffa::encoding::Tag::new(15u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.failed_videos, buf);
}
if self.failed_audios != 0u64 {
::buffa::encoding::Tag::new(16u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.failed_audios, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.id.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.status = ::buffa::types::decode_uint32(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.created_at = ::buffa::types::decode_int64(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.deleted_at = ::core::option::Option::Some(
::buffa::types::decode_int64(buf)?,
);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_files = ::buffa::types::decode_uint64(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.indexed_files = ::buffa::types::decode_uint64(buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_videos = ::buffa::types::decode_uint64(buf)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.indexed_videos = ::buffa::types::decode_uint64(buf)?;
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_scenes = ::buffa::types::decode_uint64(buf)?;
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_audios = ::buffa::types::decode_uint64(buf)?;
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.indexed_audios = ::buffa::types::decode_uint64(buf)?;
}
14u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 14u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_failed_files = ::buffa::types::decode_uint64(buf)?;
}
15u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.failed_videos = ::buffa::types::decode_uint64(buf)?;
}
16u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 16u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.failed_audios = ::buffa::types::decode_uint64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::MessageField::none();
self.location = ::buffa::MessageField::none();
self.name = ::core::default::Default::default();
self.status = 0u32;
self.created_at = 0i64;
self.deleted_at = ::core::option::Option::None;
self.total_files = 0u64;
self.indexed_files = 0u64;
self.total_videos = 0u64;
self.indexed_videos = 0u64;
self.total_scenes = 0u64;
self.total_audios = 0u64;
self.indexed_audios = 0u64;
self.total_failed_files = 0u64;
self.failed_videos = 0u64;
self.failed_audios = 0u64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for WatchedLocation {
const PROTO_FQN: &'static str = "media.v1.WatchedLocation";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for WatchedLocation {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __WATCHED_LOCATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.WatchedLocation",
to_json: ::buffa::type_registry::any_to_json::<WatchedLocation>,
from_json: ::buffa::type_registry::any_from_json::<WatchedLocation>,
is_wkt: false,
};
/// Metadata for a storage volume.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VolumeMeta {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub id: ::buffa::MessageField<Id>,
/// Field 2: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
/// Field 3: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 4: `total_size`
#[cfg_attr(
feature = "json",
serde(
rename = "totalSize",
alias = "total_size",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_size: u64,
/// Field 5: `used_size`
#[cfg_attr(
feature = "json",
serde(
rename = "usedSize",
alias = "used_size",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub used_size: u64,
/// VolumeStatus bitflags (EJECTABLE=1, ACTIVE=2)
///
/// Field 6: `status`
#[cfg_attr(
feature = "json",
serde(
rename = "status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub status: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VolumeMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VolumeMeta")
.field("id", &self.id)
.field("location", &self.location)
.field("name", &self.name)
.field("total_size", &self.total_size)
.field("used_size", &self.used_size)
.field("status", &self.status)
.finish()
}
}
impl VolumeMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VolumeMeta";
}
impl ::buffa::DefaultInstance for VolumeMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VolumeMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VolumeMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VolumeMeta";
const FULL_NAME: &'static str = "media.v1.VolumeMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VolumeMeta";
}
impl ::buffa::Message for VolumeMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_set() {
let __slot = __cache.reserve();
let inner_size = self.id.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if self.total_size != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_size) as u32;
}
if self.used_size != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.used_size) as u32;
}
if self.status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.status) 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.id.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.id.write_to(__cache, buf);
}
if self.location.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.write_to(__cache, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.total_size != 0u64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_size, buf);
}
if self.used_size != 0u64 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.used_size, buf);
}
if self.status != 0u32 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.status, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.id.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_size = ::buffa::types::decode_uint64(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.used_size = ::buffa::types::decode_uint64(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.status = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::MessageField::none();
self.location = ::buffa::MessageField::none();
self.name = ::core::default::Default::default();
self.total_size = 0u64;
self.used_size = 0u64;
self.status = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VolumeMeta {
const PROTO_FQN: &'static str = "media.v1.VolumeMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VolumeMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VOLUME_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VolumeMeta",
to_json: ::buffa::type_registry::any_to_json::<VolumeMeta>,
from_json: ::buffa::type_registry::any_from_json::<VolumeMeta>,
is_wkt: false,
};
/// Single-Detection envelope: image-level classification result.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ClassificationDetection {
/// Field 1: `detection`
#[cfg_attr(
feature = "json",
serde(
rename = "detection",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub detection: ::buffa::MessageField<Detection>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ClassificationDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ClassificationDetection")
.field("detection", &self.detection)
.finish()
}
}
impl ClassificationDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ClassificationDetection";
}
impl ::buffa::DefaultInstance for ClassificationDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ClassificationDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ClassificationDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ClassificationDetection";
const FULL_NAME: &'static str = "media.v1.ClassificationDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ClassificationDetection";
}
impl ::buffa::Message for ClassificationDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.detection.is_set() {
let __slot = __cache.reserve();
let inner_size = self.detection.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.detection.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.detection.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.detection.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.detection = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ClassificationDetection {
const PROTO_FQN: &'static str = "media.v1.ClassificationDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ClassificationDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __CLASSIFICATION_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ClassificationDetection",
to_json: ::buffa::type_registry::any_to_json::<ClassificationDetection>,
from_json: ::buffa::type_registry::any_from_json::<ClassificationDetection>,
is_wkt: false,
};
/// Single-Detection envelope: detected action/activity.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ActionDetection {
/// Field 1: `detection`
#[cfg_attr(
feature = "json",
serde(
rename = "detection",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub detection: ::buffa::MessageField<Detection>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ActionDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ActionDetection").field("detection", &self.detection).finish()
}
}
impl ActionDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ActionDetection";
}
impl ::buffa::DefaultInstance for ActionDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ActionDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ActionDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ActionDetection";
const FULL_NAME: &'static str = "media.v1.ActionDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ActionDetection";
}
impl ::buffa::Message for ActionDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.detection.is_set() {
let __slot = __cache.reserve();
let inner_size = self.detection.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.detection.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.detection.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.detection.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.detection = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ActionDetection {
const PROTO_FQN: &'static str = "media.v1.ActionDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ActionDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __ACTION_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ActionDetection",
to_json: ::buffa::type_registry::any_to_json::<ActionDetection>,
from_json: ::buffa::type_registry::any_from_json::<ActionDetection>,
is_wkt: false,
};
/// Single-Detection envelope: detected emotion.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct EmotionDetection {
/// Field 1: `detection`
#[cfg_attr(
feature = "json",
serde(
rename = "detection",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub detection: ::buffa::MessageField<Detection>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for EmotionDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("EmotionDetection").field("detection", &self.detection).finish()
}
}
impl EmotionDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.EmotionDetection";
}
impl ::buffa::DefaultInstance for EmotionDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<EmotionDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for EmotionDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "EmotionDetection";
const FULL_NAME: &'static str = "media.v1.EmotionDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.EmotionDetection";
}
impl ::buffa::Message for EmotionDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.detection.is_set() {
let __slot = __cache.reserve();
let inner_size = self.detection.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.detection.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.detection.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.detection.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.detection = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for EmotionDetection {
const PROTO_FQN: &'static str = "media.v1.EmotionDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for EmotionDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __EMOTION_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.EmotionDetection",
to_json: ::buffa::type_registry::any_to_json::<EmotionDetection>,
from_json: ::buffa::type_registry::any_from_json::<EmotionDetection>,
is_wkt: false,
};
/// Single-Detection envelope: scene mood/atmosphere.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct MoodDetection {
/// Field 1: `detection`
#[cfg_attr(
feature = "json",
serde(
rename = "detection",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub detection: ::buffa::MessageField<Detection>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for MoodDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("MoodDetection").field("detection", &self.detection).finish()
}
}
impl MoodDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.MoodDetection";
}
impl ::buffa::DefaultInstance for MoodDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<MoodDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for MoodDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "MoodDetection";
const FULL_NAME: &'static str = "media.v1.MoodDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.MoodDetection";
}
impl ::buffa::Message for MoodDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.detection.is_set() {
let __slot = __cache.reserve();
let inner_size = self.detection.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.detection.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.detection.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.detection.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.detection = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for MoodDetection {
const PROTO_FQN: &'static str = "media.v1.MoodDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for MoodDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __MOOD_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.MoodDetection",
to_json: ::buffa::type_registry::any_to_json::<MoodDetection>,
from_json: ::buffa::type_registry::any_from_json::<MoodDetection>,
is_wkt: false,
};
/// Single-Detection envelope: lighting condition.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct LightingDetection {
/// Field 1: `detection`
#[cfg_attr(
feature = "json",
serde(
rename = "detection",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub detection: ::buffa::MessageField<Detection>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for LightingDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("LightingDetection").field("detection", &self.detection).finish()
}
}
impl LightingDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LightingDetection";
}
impl ::buffa::DefaultInstance for LightingDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<LightingDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for LightingDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "LightingDetection";
const FULL_NAME: &'static str = "media.v1.LightingDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LightingDetection";
}
impl ::buffa::Message for LightingDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.detection.is_set() {
let __slot = __cache.reserve();
let inner_size = self.detection.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.detection.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.detection.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.detection.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.detection = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for LightingDetection {
const PROTO_FQN: &'static str = "media.v1.LightingDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for LightingDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LIGHTING_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.LightingDetection",
to_json: ::buffa::type_registry::any_to_json::<LightingDetection>,
from_json: ::buffa::type_registry::any_from_json::<LightingDetection>,
is_wkt: false,
};
/// Single-Detection envelope: dominant color (confidence = dominance).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ColorDetection {
/// Field 1: `detection`
#[cfg_attr(
feature = "json",
serde(
rename = "detection",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub detection: ::buffa::MessageField<Detection>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ColorDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ColorDetection").field("detection", &self.detection).finish()
}
}
impl ColorDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ColorDetection";
}
impl ::buffa::DefaultInstance for ColorDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ColorDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ColorDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ColorDetection";
const FULL_NAME: &'static str = "media.v1.ColorDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ColorDetection";
}
impl ::buffa::Message for ColorDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.detection.is_set() {
let __slot = __cache.reserve();
let inner_size = self.detection.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.detection.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.detection.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.detection.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.detection = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ColorDetection {
const PROTO_FQN: &'static str = "media.v1.ColorDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ColorDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __COLOR_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ColorDetection",
to_json: ::buffa::type_registry::any_to_json::<ColorDetection>,
from_json: ::buffa::type_registry::any_from_json::<ColorDetection>,
is_wkt: false,
};
/// A detected object: classification + optional bounding box.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ObjectDetection {
/// Field 1: `detection`
#[cfg_attr(
feature = "json",
serde(
rename = "detection",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub detection: ::buffa::MessageField<Detection>,
/// Field 2: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ObjectDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ObjectDetection")
.field("detection", &self.detection)
.field("bbox", &self.bbox)
.finish()
}
}
impl ObjectDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ObjectDetection";
}
impl ::buffa::DefaultInstance for ObjectDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ObjectDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ObjectDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ObjectDetection";
const FULL_NAME: &'static str = "media.v1.ObjectDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ObjectDetection";
}
impl ::buffa::Message for ObjectDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.detection.is_set() {
let __slot = __cache.reserve();
let inner_size = self.detection.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.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.detection.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.detection.write_to(__cache, buf);
}
if self.bbox.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.detection.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.detection = ::buffa::MessageField::none();
self.bbox = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ObjectDetection {
const PROTO_FQN: &'static str = "media.v1.ObjectDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ObjectDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __OBJECT_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ObjectDetection",
to_json: ::buffa::type_registry::any_to_json::<ObjectDetection>,
from_json: ::buffa::type_registry::any_from_json::<ObjectDetection>,
is_wkt: false,
};
/// A detected subject (e.g. Human/Cat): classification + bounding box.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SubjectDetection {
/// Field 1: `detection`
#[cfg_attr(
feature = "json",
serde(
rename = "detection",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub detection: ::buffa::MessageField<Detection>,
/// Field 2: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SubjectDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SubjectDetection")
.field("detection", &self.detection)
.field("bbox", &self.bbox)
.finish()
}
}
impl SubjectDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubjectDetection";
}
impl ::buffa::DefaultInstance for SubjectDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SubjectDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SubjectDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SubjectDetection";
const FULL_NAME: &'static str = "media.v1.SubjectDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubjectDetection";
}
impl ::buffa::Message for SubjectDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.detection.is_set() {
let __slot = __cache.reserve();
let inner_size = self.detection.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.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.detection.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.detection.write_to(__cache, buf);
}
if self.bbox.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.detection.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.detection = ::buffa::MessageField::none();
self.bbox = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SubjectDetection {
const PROTO_FQN: &'static str = "media.v1.SubjectDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SubjectDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SUBJECT_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SubjectDetection",
to_json: ::buffa::type_registry::any_to_json::<SubjectDetection>,
from_json: ::buffa::type_registry::any_from_json::<SubjectDetection>,
is_wkt: false,
};
/// Recognized text with location.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct TextDetection {
/// Field 1: `text`
#[cfg_attr(
feature = "json",
serde(
rename = "text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub text: ::buffa::smol_str::SmolStr,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
/// Field 3: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for TextDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("TextDetection")
.field("text", &self.text)
.field("confidence", &self.confidence)
.field("bbox", &self.bbox)
.finish()
}
}
impl TextDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TextDetection";
}
impl ::buffa::DefaultInstance for TextDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<TextDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for TextDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "TextDetection";
const FULL_NAME: &'static str = "media.v1.TextDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TextDetection";
}
impl ::buffa::Message for TextDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.text) as u32;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.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.text.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.text, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
if self.bbox.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.text = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.text = ::core::default::Default::default();
self.confidence = 0f32;
self.bbox = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for TextDetection {
const PROTO_FQN: &'static str = "media.v1.TextDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for TextDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TEXT_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.TextDetection",
to_json: ::buffa::type_registry::any_to_json::<TextDetection>,
from_json: ::buffa::type_registry::any_from_json::<TextDetection>,
is_wkt: false,
};
/// Decoded barcode/QR with location.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct BarcodeDetection {
/// Field 1: `payload`
#[cfg_attr(
feature = "json",
serde(
rename = "payload",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub payload: ::buffa::smol_str::SmolStr,
/// Field 2: `symbology`
#[cfg_attr(
feature = "json",
serde(
rename = "symbology",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub symbology: ::buffa::smol_str::SmolStr,
/// Field 3: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
/// Field 4: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BarcodeDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BarcodeDetection")
.field("payload", &self.payload)
.field("symbology", &self.symbology)
.field("confidence", &self.confidence)
.field("bbox", &self.bbox)
.finish()
}
}
impl BarcodeDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BarcodeDetection";
}
impl ::buffa::DefaultInstance for BarcodeDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<BarcodeDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for BarcodeDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "BarcodeDetection";
const FULL_NAME: &'static str = "media.v1.BarcodeDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BarcodeDetection";
}
impl ::buffa::Message for BarcodeDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.payload.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.payload) as u32;
}
if !self.symbology.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.symbology) as u32;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.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.payload.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.payload, buf);
}
if !self.symbology.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.symbology, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
if self.bbox.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.payload = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.symbology = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.payload = ::core::default::Default::default();
self.symbology = ::core::default::Default::default();
self.confidence = 0f32;
self.bbox = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BarcodeDetection {
const PROTO_FQN: &'static str = "media.v1.BarcodeDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for BarcodeDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __BARCODE_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.BarcodeDetection",
to_json: ::buffa::type_registry::any_to_json::<BarcodeDetection>,
from_json: ::buffa::type_registry::any_from_json::<BarcodeDetection>,
is_wkt: false,
};
/// Detected face with pose angles.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct FaceDetection {
/// Field 1: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
/// Field 3: `capture_quality`
#[cfg_attr(
feature = "json",
serde(
rename = "captureQuality",
alias = "capture_quality",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub capture_quality: f32,
/// Field 4: `roll`
#[cfg_attr(
feature = "json",
serde(
rename = "roll",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub roll: f32,
/// Field 5: `yaw`
#[cfg_attr(
feature = "json",
serde(
rename = "yaw",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub yaw: f32,
/// Field 6: `pitch`
#[cfg_attr(
feature = "json",
serde(
rename = "pitch",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub pitch: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FaceDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FaceDetection")
.field("bbox", &self.bbox)
.field("confidence", &self.confidence)
.field("capture_quality", &self.capture_quality)
.field("roll", &self.roll)
.field("yaw", &self.yaw)
.field("pitch", &self.pitch)
.finish()
}
}
impl FaceDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FaceDetection";
}
impl ::buffa::DefaultInstance for FaceDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FaceDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for FaceDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "FaceDetection";
const FULL_NAME: &'static str = "media.v1.FaceDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FaceDetection";
}
impl ::buffa::Message for FaceDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.capture_quality.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.roll.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.yaw.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.pitch.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.bbox.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.write_to(__cache, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
if self.capture_quality.to_bits() != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.capture_quality, buf);
}
if self.roll.to_bits() != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.roll, buf);
}
if self.yaw.to_bits() != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.yaw, buf);
}
if self.pitch.to_bits() != 0u32 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.pitch, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.capture_quality = ::buffa::types::decode_float(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.roll = ::buffa::types::decode_float(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.yaw = ::buffa::types::decode_float(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.pitch = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.bbox = ::buffa::MessageField::none();
self.confidence = 0f32;
self.capture_quality = 0f32;
self.roll = 0f32;
self.yaw = 0f32;
self.pitch = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FaceDetection {
const PROTO_FQN: &'static str = "media.v1.FaceDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for FaceDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __FACE_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.FaceDetection",
to_json: ::buffa::type_registry::any_to_json::<FaceDetection>,
from_json: ::buffa::type_registry::any_from_json::<FaceDetection>,
is_wkt: false,
};
/// A salient region of interest.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SaliencyRegion {
/// Field 1: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SaliencyRegion {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SaliencyRegion")
.field("bbox", &self.bbox)
.field("confidence", &self.confidence)
.finish()
}
}
impl SaliencyRegion {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SaliencyRegion";
}
impl ::buffa::DefaultInstance for SaliencyRegion {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SaliencyRegion> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SaliencyRegion {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SaliencyRegion";
const FULL_NAME: &'static str = "media.v1.SaliencyRegion";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SaliencyRegion";
}
impl ::buffa::Message for SaliencyRegion {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.bbox.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.write_to(__cache, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.bbox = ::buffa::MessageField::none();
self.confidence = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SaliencyRegion {
const PROTO_FQN: &'static str = "media.v1.SaliencyRegion";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SaliencyRegion {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SALIENCY_REGION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SaliencyRegion",
to_json: ::buffa::type_registry::any_to_json::<SaliencyRegion>,
from_json: ::buffa::type_registry::any_from_json::<SaliencyRegion>,
is_wkt: false,
};
/// A single 2D landmark point on a face.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct FaceLandmarkPoint {
/// Field 1: `x`
#[cfg_attr(
feature = "json",
serde(
rename = "x",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub x: f32,
/// Field 2: `y`
#[cfg_attr(
feature = "json",
serde(
rename = "y",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub y: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FaceLandmarkPoint {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FaceLandmarkPoint")
.field("x", &self.x)
.field("y", &self.y)
.finish()
}
}
impl FaceLandmarkPoint {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FaceLandmarkPoint";
}
impl ::buffa::DefaultInstance for FaceLandmarkPoint {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FaceLandmarkPoint> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for FaceLandmarkPoint {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "FaceLandmarkPoint";
const FULL_NAME: &'static str = "media.v1.FaceLandmarkPoint";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FaceLandmarkPoint";
}
impl ::buffa::Message for FaceLandmarkPoint {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.x.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.y.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.x.to_bits() != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.x, buf);
}
if self.y.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.y, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.x = ::buffa::types::decode_float(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.y = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.x = 0f32;
self.y = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FaceLandmarkPoint {
const PROTO_FQN: &'static str = "media.v1.FaceLandmarkPoint";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for FaceLandmarkPoint {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __FACE_LANDMARK_POINT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.FaceLandmarkPoint",
to_json: ::buffa::type_registry::any_to_json::<FaceLandmarkPoint>,
from_json: ::buffa::type_registry::any_from_json::<FaceLandmarkPoint>,
is_wkt: false,
};
/// A named region of face landmarks (e.g. "left_eye", "nose").
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct FaceLandmarkRegion {
/// Field 1: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 2: `points`
#[cfg_attr(
feature = "json",
serde(
rename = "points",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub points: ::buffa::alloc::vec::Vec<FaceLandmarkPoint>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FaceLandmarkRegion {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FaceLandmarkRegion")
.field("name", &self.name)
.field("points", &self.points)
.finish()
}
}
impl FaceLandmarkRegion {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FaceLandmarkRegion";
}
impl ::buffa::DefaultInstance for FaceLandmarkRegion {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FaceLandmarkRegion> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for FaceLandmarkRegion {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "FaceLandmarkRegion";
const FULL_NAME: &'static str = "media.v1.FaceLandmarkRegion";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FaceLandmarkRegion";
}
impl ::buffa::Message for FaceLandmarkRegion {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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;
}
for v in &self.points {
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 _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
for v in &self.points {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.points.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::default::Default::default();
self.points.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FaceLandmarkRegion {
const PROTO_FQN: &'static str = "media.v1.FaceLandmarkRegion";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for FaceLandmarkRegion {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __FACE_LANDMARK_REGION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.FaceLandmarkRegion",
to_json: ::buffa::type_registry::any_to_json::<FaceLandmarkRegion>,
from_json: ::buffa::type_registry::any_from_json::<FaceLandmarkRegion>,
is_wkt: false,
};
/// Face landmark detection result: bbox + confidence + named regions.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct FaceLandmarksDetection {
/// Field 1: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
/// Field 3: `regions`
#[cfg_attr(
feature = "json",
serde(
rename = "regions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub regions: ::buffa::alloc::vec::Vec<FaceLandmarkRegion>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FaceLandmarksDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FaceLandmarksDetection")
.field("bbox", &self.bbox)
.field("confidence", &self.confidence)
.field("regions", &self.regions)
.finish()
}
}
impl FaceLandmarksDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FaceLandmarksDetection";
}
impl ::buffa::DefaultInstance for FaceLandmarksDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FaceLandmarksDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for FaceLandmarksDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "FaceLandmarksDetection";
const FULL_NAME: &'static str = "media.v1.FaceLandmarksDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FaceLandmarksDetection";
}
impl ::buffa::Message for FaceLandmarksDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
for v in &self.regions {
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 _;
if self.bbox.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.write_to(__cache, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
for v in &self.regions {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.regions.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.bbox = ::buffa::MessageField::none();
self.confidence = 0f32;
self.regions.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FaceLandmarksDetection {
const PROTO_FQN: &'static str = "media.v1.FaceLandmarksDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for FaceLandmarksDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __FACE_LANDMARKS_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.FaceLandmarksDetection",
to_json: ::buffa::type_registry::any_to_json::<FaceLandmarksDetection>,
from_json: ::buffa::type_registry::any_from_json::<FaceLandmarksDetection>,
is_wkt: false,
};
/// A single body-pose joint with 2D position and confidence.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct BodyPoseJoint {
/// Field 1: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 2: `x`
#[cfg_attr(
feature = "json",
serde(
rename = "x",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub x: f32,
/// Field 3: `y`
#[cfg_attr(
feature = "json",
serde(
rename = "y",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub y: f32,
/// Field 4: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BodyPoseJoint {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BodyPoseJoint")
.field("name", &self.name)
.field("x", &self.x)
.field("y", &self.y)
.field("confidence", &self.confidence)
.finish()
}
}
impl BodyPoseJoint {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BodyPoseJoint";
}
impl ::buffa::DefaultInstance for BodyPoseJoint {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<BodyPoseJoint> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for BodyPoseJoint {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "BodyPoseJoint";
const FULL_NAME: &'static str = "media.v1.BodyPoseJoint";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BodyPoseJoint";
}
impl ::buffa::Message for BodyPoseJoint {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.x.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.y.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.x.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.x, buf);
}
if self.y.to_bits() != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.y, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.x = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.y = ::buffa::types::decode_float(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::default::Default::default();
self.x = 0f32;
self.y = 0f32;
self.confidence = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BodyPoseJoint {
const PROTO_FQN: &'static str = "media.v1.BodyPoseJoint";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for BodyPoseJoint {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __BODY_POSE_JOINT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.BodyPoseJoint",
to_json: ::buffa::type_registry::any_to_json::<BodyPoseJoint>,
from_json: ::buffa::type_registry::any_from_json::<BodyPoseJoint>,
is_wkt: false,
};
/// Body pose detection result: bbox + confidence + joint list.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct BodyPoseDetection {
/// Field 1: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
/// Field 3: `joints`
#[cfg_attr(
feature = "json",
serde(
rename = "joints",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub joints: ::buffa::alloc::vec::Vec<BodyPoseJoint>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BodyPoseDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BodyPoseDetection")
.field("bbox", &self.bbox)
.field("confidence", &self.confidence)
.field("joints", &self.joints)
.finish()
}
}
impl BodyPoseDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BodyPoseDetection";
}
impl ::buffa::DefaultInstance for BodyPoseDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<BodyPoseDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for BodyPoseDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "BodyPoseDetection";
const FULL_NAME: &'static str = "media.v1.BodyPoseDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BodyPoseDetection";
}
impl ::buffa::Message for BodyPoseDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
for v in &self.joints {
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 _;
if self.bbox.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.write_to(__cache, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
for v in &self.joints {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.joints.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.bbox = ::buffa::MessageField::none();
self.confidence = 0f32;
self.joints.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BodyPoseDetection {
const PROTO_FQN: &'static str = "media.v1.BodyPoseDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for BodyPoseDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __BODY_POSE_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.BodyPoseDetection",
to_json: ::buffa::type_registry::any_to_json::<BodyPoseDetection>,
from_json: ::buffa::type_registry::any_from_json::<BodyPoseDetection>,
is_wkt: false,
};
/// A single 3D body-pose joint with x/y/z position and confidence.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct BodyPose3DJoint {
/// Field 1: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 2: `x`
#[cfg_attr(
feature = "json",
serde(
rename = "x",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub x: f32,
/// Field 3: `y`
#[cfg_attr(
feature = "json",
serde(
rename = "y",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub y: f32,
/// Field 4: `z`
#[cfg_attr(
feature = "json",
serde(
rename = "z",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub z: f32,
/// Field 5: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BodyPose3DJoint {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BodyPose3DJoint")
.field("name", &self.name)
.field("x", &self.x)
.field("y", &self.y)
.field("z", &self.z)
.field("confidence", &self.confidence)
.finish()
}
}
impl BodyPose3DJoint {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BodyPose3DJoint";
}
impl ::buffa::DefaultInstance for BodyPose3DJoint {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<BodyPose3DJoint> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for BodyPose3DJoint {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "BodyPose3DJoint";
const FULL_NAME: &'static str = "media.v1.BodyPose3DJoint";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BodyPose3DJoint";
}
impl ::buffa::Message for BodyPose3DJoint {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.x.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.y.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.z.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.x.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.x, buf);
}
if self.y.to_bits() != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.y, buf);
}
if self.z.to_bits() != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.z, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.x = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.y = ::buffa::types::decode_float(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.z = ::buffa::types::decode_float(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::default::Default::default();
self.x = 0f32;
self.y = 0f32;
self.z = 0f32;
self.confidence = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BodyPose3DJoint {
const PROTO_FQN: &'static str = "media.v1.BodyPose3DJoint";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for BodyPose3DJoint {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __BODY_POSE3D_JOINT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.BodyPose3DJoint",
to_json: ::buffa::type_registry::any_to_json::<BodyPose3DJoint>,
from_json: ::buffa::type_registry::any_from_json::<BodyPose3DJoint>,
is_wkt: false,
};
/// 3D body pose detection: confidence + height + estimation method + joint list.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct BodyPose3DDetection {
/// Field 1: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
/// Field 2: `body_height`
#[cfg_attr(
feature = "json",
serde(
rename = "bodyHeight",
alias = "body_height",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub body_height: f32,
/// Field 3: `height_estimation`
#[cfg_attr(
feature = "json",
serde(
rename = "heightEstimation",
alias = "height_estimation",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub height_estimation: ::buffa::EnumValue<BodyPose3DHeightEstimation>,
/// Field 4: `joints`
#[cfg_attr(
feature = "json",
serde(
rename = "joints",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub joints: ::buffa::alloc::vec::Vec<BodyPose3DJoint>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BodyPose3DDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BodyPose3DDetection")
.field("confidence", &self.confidence)
.field("body_height", &self.body_height)
.field("height_estimation", &self.height_estimation)
.field("joints", &self.joints)
.finish()
}
}
impl BodyPose3DDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BodyPose3DDetection";
}
impl ::buffa::DefaultInstance for BodyPose3DDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<BodyPose3DDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for BodyPose3DDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "BodyPose3DDetection";
const FULL_NAME: &'static str = "media.v1.BodyPose3DDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BodyPose3DDetection";
}
impl ::buffa::Message for BodyPose3DDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.body_height.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
{
let val = self.height_estimation.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
for v in &self.joints {
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 _;
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
if self.body_height.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.body_height, buf);
}
{
let val = self.height_estimation.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
for v in &self.joints {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.body_height = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.height_estimation = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.joints.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.confidence = 0f32;
self.body_height = 0f32;
self.height_estimation = ::buffa::EnumValue::from(0);
self.joints.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BodyPose3DDetection {
const PROTO_FQN: &'static str = "media.v1.BodyPose3DDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for BodyPose3DDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __BODY_POSE3D_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.BodyPose3DDetection",
to_json: ::buffa::type_registry::any_to_json::<BodyPose3DDetection>,
from_json: ::buffa::type_registry::any_from_json::<BodyPose3DDetection>,
is_wkt: false,
};
/// Hand pose detection result: bbox + confidence + chirality + joint list.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct HandPoseDetection {
/// Field 1: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
/// Field 3: `chirality`
#[cfg_attr(
feature = "json",
serde(
rename = "chirality",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub chirality: ::buffa::EnumValue<HandChirality>,
/// Field 4: `joints`
#[cfg_attr(
feature = "json",
serde(
rename = "joints",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub joints: ::buffa::alloc::vec::Vec<BodyPoseJoint>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for HandPoseDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("HandPoseDetection")
.field("bbox", &self.bbox)
.field("confidence", &self.confidence)
.field("chirality", &self.chirality)
.field("joints", &self.joints)
.finish()
}
}
impl HandPoseDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.HandPoseDetection";
}
impl ::buffa::DefaultInstance for HandPoseDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<HandPoseDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for HandPoseDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "HandPoseDetection";
const FULL_NAME: &'static str = "media.v1.HandPoseDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.HandPoseDetection";
}
impl ::buffa::Message for HandPoseDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
{
let val = self.chirality.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
for v in &self.joints {
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 _;
if self.bbox.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.write_to(__cache, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
{
let val = self.chirality.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
for v in &self.joints {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.chirality = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.joints.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.bbox = ::buffa::MessageField::none();
self.confidence = 0f32;
self.chirality = ::buffa::EnumValue::from(0);
self.joints.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for HandPoseDetection {
const PROTO_FQN: &'static str = "media.v1.HandPoseDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for HandPoseDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __HAND_POSE_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.HandPoseDetection",
to_json: ::buffa::type_registry::any_to_json::<HandPoseDetection>,
from_json: ::buffa::type_registry::any_from_json::<HandPoseDetection>,
is_wkt: false,
};
/// Person segmentation mask: bbox + confidence + pixel dimensions + mask bytes.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct PersonSegmentationMask {
/// Field 1: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
/// Field 3: `dimensions`
#[cfg_attr(
feature = "json",
serde(
rename = "dimensions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub dimensions: ::buffa::MessageField<Dimensions>,
/// Field 4: `data`
#[cfg_attr(
feature = "json",
serde(
rename = "data",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub data: ::buffa::bytes::Bytes,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for PersonSegmentationMask {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("PersonSegmentationMask")
.field("bbox", &self.bbox)
.field("confidence", &self.confidence)
.field("dimensions", &self.dimensions)
.field("data", &self.data)
.finish()
}
}
impl PersonSegmentationMask {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.PersonSegmentationMask";
}
impl ::buffa::DefaultInstance for PersonSegmentationMask {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<PersonSegmentationMask> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for PersonSegmentationMask {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "PersonSegmentationMask";
const FULL_NAME: &'static str = "media.v1.PersonSegmentationMask";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.PersonSegmentationMask";
}
impl ::buffa::Message for PersonSegmentationMask {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.dimensions.is_set() {
let __slot = __cache.reserve();
let inner_size = self.dimensions.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.data.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.data) 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.bbox.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.write_to(__cache, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
if self.dimensions.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.dimensions.write_to(__cache, buf);
}
if !self.data.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.data, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.dimensions.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.data = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.bbox = ::buffa::MessageField::none();
self.confidence = 0f32;
self.dimensions = ::buffa::MessageField::none();
self.data = ::buffa::bytes::Bytes::new();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for PersonSegmentationMask {
const PROTO_FQN: &'static str = "media.v1.PersonSegmentationMask";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for PersonSegmentationMask {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __PERSON_SEGMENTATION_MASK_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.PersonSegmentationMask",
to_json: ::buffa::type_registry::any_to_json::<PersonSegmentationMask>,
from_json: ::buffa::type_registry::any_from_json::<PersonSegmentationMask>,
is_wkt: false,
};
/// Per-instance person mask: bbox + confidence + instance index + dimensions + mask bytes.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct PersonInstanceMaskDetection {
/// Field 1: `bbox`
#[cfg_attr(
feature = "json",
serde(
rename = "bbox",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub bbox: ::buffa::MessageField<BoundingBox>,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
/// Field 3: `instance_index`
#[cfg_attr(
feature = "json",
serde(
rename = "instanceIndex",
alias = "instance_index",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub instance_index: u32,
/// Field 4: `dimensions`
#[cfg_attr(
feature = "json",
serde(
rename = "dimensions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub dimensions: ::buffa::MessageField<Dimensions>,
/// Field 5: `data`
#[cfg_attr(
feature = "json",
serde(
rename = "data",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub data: ::buffa::bytes::Bytes,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for PersonInstanceMaskDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("PersonInstanceMaskDetection")
.field("bbox", &self.bbox)
.field("confidence", &self.confidence)
.field("instance_index", &self.instance_index)
.field("dimensions", &self.dimensions)
.field("data", &self.data)
.finish()
}
}
impl PersonInstanceMaskDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.PersonInstanceMaskDetection";
}
impl ::buffa::DefaultInstance for PersonInstanceMaskDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<PersonInstanceMaskDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for PersonInstanceMaskDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "PersonInstanceMaskDetection";
const FULL_NAME: &'static str = "media.v1.PersonInstanceMaskDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.PersonInstanceMaskDetection";
}
impl ::buffa::Message for PersonInstanceMaskDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.instance_index != 0u32 {
size
+= 1u32 + ::buffa::types::uint32_encoded_len(self.instance_index) as u32;
}
if self.dimensions.is_set() {
let __slot = __cache.reserve();
let inner_size = self.dimensions.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.data.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.data) 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.bbox.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.bbox.write_to(__cache, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
if self.instance_index != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.instance_index, buf);
}
if self.dimensions.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.dimensions.write_to(__cache, buf);
}
if !self.data.is_empty() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.data, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.instance_index = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.dimensions.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.data = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.bbox = ::buffa::MessageField::none();
self.confidence = 0f32;
self.instance_index = 0u32;
self.dimensions = ::buffa::MessageField::none();
self.data = ::buffa::bytes::Bytes::new();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for PersonInstanceMaskDetection {
const PROTO_FQN: &'static str = "media.v1.PersonInstanceMaskDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for PersonInstanceMaskDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __PERSON_INSTANCE_MASK_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.PersonInstanceMaskDetection",
to_json: ::buffa::type_registry::any_to_json::<PersonInstanceMaskDetection>,
from_json: ::buffa::type_registry::any_from_json::<PersonInstanceMaskDetection>,
is_wkt: false,
};
/// Timing ranges for a media track: declared, packet-observed, and decoded-observed.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct TrackTime {
/// Field 1: `declared`
#[cfg_attr(
feature = "json",
serde(
rename = "declared",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub declared: ::buffa::MessageField<::mediatime::TimeRange>,
/// Field 2: `packet_observed`
#[cfg_attr(
feature = "json",
serde(
rename = "packetObserved",
alias = "packet_observed",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub packet_observed: ::buffa::MessageField<::mediatime::TimeRange>,
/// Field 3: `decoded_observed`
#[cfg_attr(
feature = "json",
serde(
rename = "decodedObserved",
alias = "decoded_observed",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub decoded_observed: ::buffa::MessageField<::mediatime::TimeRange>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for TrackTime {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("TrackTime")
.field("declared", &self.declared)
.field("packet_observed", &self.packet_observed)
.field("decoded_observed", &self.decoded_observed)
.finish()
}
}
impl TrackTime {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TrackTime";
}
impl ::buffa::DefaultInstance for TrackTime {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<TrackTime> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for TrackTime {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "TrackTime";
const FULL_NAME: &'static str = "media.v1.TrackTime";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TrackTime";
}
impl ::buffa::Message for TrackTime {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.declared.is_set() {
let __slot = __cache.reserve();
let inner_size = self.declared.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.packet_observed.is_set() {
let __slot = __cache.reserve();
let inner_size = self.packet_observed.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.decoded_observed.is_set() {
let __slot = __cache.reserve();
let inner_size = self.decoded_observed.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.declared.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.declared.write_to(__cache, buf);
}
if self.packet_observed.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.packet_observed.write_to(__cache, buf);
}
if self.decoded_observed.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.decoded_observed.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.declared.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.packet_observed.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.decoded_observed.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.declared = ::buffa::MessageField::none();
self.packet_observed = ::buffa::MessageField::none();
self.decoded_observed = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for TrackTime {
const PROTO_FQN: &'static str = "media.v1.TrackTime";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for TrackTime {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TRACK_TIME_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.TrackTime",
to_json: ::buffa::type_registry::any_to_json::<TrackTime>,
from_json: ::buffa::type_registry::any_from_json::<TrackTime>,
is_wkt: false,
};
/// Animal analysis aggregate: subject detections + body poses.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AnimalAnalysis {
/// Field 1: `subjects`
#[cfg_attr(
feature = "json",
serde(
rename = "subjects",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub subjects: ::buffa::alloc::vec::Vec<SubjectDetection>,
/// Field 2: `body_poses`
#[cfg_attr(
feature = "json",
serde(
rename = "bodyPoses",
alias = "body_poses",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub body_poses: ::buffa::alloc::vec::Vec<BodyPoseDetection>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AnimalAnalysis {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AnimalAnalysis")
.field("subjects", &self.subjects)
.field("body_poses", &self.body_poses)
.finish()
}
}
impl AnimalAnalysis {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AnimalAnalysis";
}
impl ::buffa::DefaultInstance for AnimalAnalysis {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AnimalAnalysis> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AnimalAnalysis {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AnimalAnalysis";
const FULL_NAME: &'static str = "media.v1.AnimalAnalysis";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AnimalAnalysis";
}
impl ::buffa::Message for AnimalAnalysis {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.subjects {
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;
}
for v in &self.body_poses {
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.subjects {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.body_poses {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.subjects.push(elem);
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.body_poses.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subjects.clear();
self.body_poses.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AnimalAnalysis {
const PROTO_FQN: &'static str = "media.v1.AnimalAnalysis";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AnimalAnalysis {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __ANIMAL_ANALYSIS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AnimalAnalysis",
to_json: ::buffa::type_registry::any_to_json::<AnimalAnalysis>,
from_json: ::buffa::type_registry::any_from_json::<AnimalAnalysis>,
is_wkt: false,
};
/// Human analysis aggregate: subjects, faces, body/hand poses, 3D poses, masks, landmarks, and segmentation.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct HumanAnalysis {
/// Field 1: `subjects`
#[cfg_attr(
feature = "json",
serde(
rename = "subjects",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub subjects: ::buffa::alloc::vec::Vec<SubjectDetection>,
/// Field 2: `faces`
#[cfg_attr(
feature = "json",
serde(
rename = "faces",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub faces: ::buffa::alloc::vec::Vec<FaceDetection>,
/// Field 3: `body_poses`
#[cfg_attr(
feature = "json",
serde(
rename = "bodyPoses",
alias = "body_poses",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub body_poses: ::buffa::alloc::vec::Vec<BodyPoseDetection>,
/// Field 4: `hand_poses`
#[cfg_attr(
feature = "json",
serde(
rename = "handPoses",
alias = "hand_poses",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub hand_poses: ::buffa::alloc::vec::Vec<HandPoseDetection>,
/// Field 5: `body_poses_3d`
#[cfg_attr(
feature = "json",
serde(
rename = "bodyPoses3d",
alias = "body_poses_3d",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub body_poses_3d: ::buffa::alloc::vec::Vec<BodyPose3DDetection>,
/// Field 6: `instance_masks`
#[cfg_attr(
feature = "json",
serde(
rename = "instanceMasks",
alias = "instance_masks",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub instance_masks: ::buffa::alloc::vec::Vec<PersonInstanceMaskDetection>,
/// Field 7: `face_rectangles`
#[cfg_attr(
feature = "json",
serde(
rename = "faceRectangles",
alias = "face_rectangles",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub face_rectangles: ::buffa::alloc::vec::Vec<FaceDetection>,
/// Field 8: `face_landmarks`
#[cfg_attr(
feature = "json",
serde(
rename = "faceLandmarks",
alias = "face_landmarks",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub face_landmarks: ::buffa::alloc::vec::Vec<FaceLandmarksDetection>,
/// Field 9: `segmentation_masks`
#[cfg_attr(
feature = "json",
serde(
rename = "segmentationMasks",
alias = "segmentation_masks",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub segmentation_masks: ::buffa::alloc::vec::Vec<PersonSegmentationMask>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for HumanAnalysis {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("HumanAnalysis")
.field("subjects", &self.subjects)
.field("faces", &self.faces)
.field("body_poses", &self.body_poses)
.field("hand_poses", &self.hand_poses)
.field("body_poses_3d", &self.body_poses_3d)
.field("instance_masks", &self.instance_masks)
.field("face_rectangles", &self.face_rectangles)
.field("face_landmarks", &self.face_landmarks)
.field("segmentation_masks", &self.segmentation_masks)
.finish()
}
}
impl HumanAnalysis {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.HumanAnalysis";
}
impl ::buffa::DefaultInstance for HumanAnalysis {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<HumanAnalysis> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for HumanAnalysis {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "HumanAnalysis";
const FULL_NAME: &'static str = "media.v1.HumanAnalysis";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.HumanAnalysis";
}
impl ::buffa::Message for HumanAnalysis {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.subjects {
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;
}
for v in &self.faces {
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;
}
for v in &self.body_poses {
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;
}
for v in &self.hand_poses {
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;
}
for v in &self.body_poses_3d {
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;
}
for v in &self.instance_masks {
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;
}
for v in &self.face_rectangles {
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;
}
for v in &self.face_landmarks {
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;
}
for v in &self.segmentation_masks {
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.subjects {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.faces {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.body_poses {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.hand_poses {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.body_poses_3d {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.instance_masks {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.face_rectangles {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.face_landmarks {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.segmentation_masks {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.subjects.push(elem);
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.faces.push(elem);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.body_poses.push(elem);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.hand_poses.push(elem);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.body_poses_3d.push(elem);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.instance_masks.push(elem);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.face_rectangles.push(elem);
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.face_landmarks.push(elem);
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.segmentation_masks.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subjects.clear();
self.faces.clear();
self.body_poses.clear();
self.hand_poses.clear();
self.body_poses_3d.clear();
self.instance_masks.clear();
self.face_rectangles.clear();
self.face_landmarks.clear();
self.segmentation_masks.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for HumanAnalysis {
const PROTO_FQN: &'static str = "media.v1.HumanAnalysis";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for HumanAnalysis {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __HUMAN_ANALYSIS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.HumanAnalysis",
to_json: ::buffa::type_registry::any_to_json::<HumanAnalysis>,
from_json: ::buffa::type_registry::any_from_json::<HumanAnalysis>,
is_wkt: false,
};
/// ── SP2: findit `database` domain (consolidated into media.v1) ──────────────
///
/// SP2 — findit `database` domain. Authored from findit-proto's
/// src/database/ Rust as a clean proto3 redesign (NO wire-compat with the
/// hand-rolled encoding; correctness = round-trip + semantic fidelity).
///
/// REUSE, NEVER REDEFINE: every type below is same-package (media.v1).
/// Same-package (media.v1) since the mono-consolidation; the SP2 `MediaKind` enum is named `DbMediaKind` to avoid colliding with SP1's `MediaKind` oneof.
///
/// Task-0 codegen smoke fixture (NOT a domain message): proves the
/// SP2 database-domain same-package reference (message + enum), the
/// inline-bytes id convention, and the mediatime.v1.TimeRange extern, all
/// resolving in a single buffa codegen run. Kept permanently: it is the
/// regression guard for the SP2 codegen pipeline (mirrors SP0's
/// TimedDetection fixture role).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Sp2CodegenSmoke {
/// inline-bytes id convention
///
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// same-package MESSAGE ref (was cross-package media.v1)
///
/// Field 2: `error`
#[cfg_attr(
feature = "json",
serde(
rename = "error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub error: ::buffa::MessageField<ErrorInfo>,
/// same-package ENUM ref (was cross-package media.v1)
///
/// Field 3: `format`
#[cfg_attr(
feature = "json",
serde(
rename = "format",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub format: ::buffa::EnumValue<VideoFormat>,
/// mediatime extern (-\> ::mediatime)
///
/// Field 4: `range`
#[cfg_attr(
feature = "json",
serde(
rename = "range",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub range: ::buffa::MessageField<::mediatime::TimeRange>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Sp2CodegenSmoke {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Sp2CodegenSmoke")
.field("id", &self.id)
.field("error", &self.error)
.field("format", &self.format)
.field("range", &self.range)
.finish()
}
}
impl Sp2CodegenSmoke {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Sp2CodegenSmoke";
}
impl ::buffa::DefaultInstance for Sp2CodegenSmoke {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Sp2CodegenSmoke> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Sp2CodegenSmoke {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Sp2CodegenSmoke";
const FULL_NAME: &'static str = "media.v1.Sp2CodegenSmoke";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Sp2CodegenSmoke";
}
impl ::buffa::Message for Sp2CodegenSmoke {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if self.error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.error.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
{
let val = self.format.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.range.is_set() {
let __slot = __cache.reserve();
let inner_size = self.range.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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if self.error.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.error.write_to(__cache, buf);
}
{
let val = self.format.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.range.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.range.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.error.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.format = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.range.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.error = ::buffa::MessageField::none();
self.format = ::buffa::EnumValue::from(0);
self.range = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Sp2CodegenSmoke {
const PROTO_FQN: &'static str = "media.v1.Sp2CodegenSmoke";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Sp2CodegenSmoke {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SP2CODEGEN_SMOKE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Sp2CodegenSmoke",
to_json: ::buffa::type_registry::any_to_json::<Sp2CodegenSmoke>,
from_json: ::buffa::type_registry::any_from_json::<Sp2CodegenSmoke>,
is_wkt: false,
};
/// ── Batch 2: audio scalar leaves (§6.5 leaves table) ────────────────────────
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct TagConfidence {
/// Field 1: `label`
#[cfg_attr(
feature = "json",
serde(
rename = "label",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub label: ::buffa::smol_str::SmolStr,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for TagConfidence {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("TagConfidence")
.field("label", &self.label)
.field("confidence", &self.confidence)
.finish()
}
}
impl TagConfidence {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TagConfidence";
}
impl ::buffa::DefaultInstance for TagConfidence {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<TagConfidence> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for TagConfidence {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "TagConfidence";
const FULL_NAME: &'static str = "media.v1.TagConfidence";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TagConfidence";
}
impl ::buffa::Message for TagConfidence {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.label.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.label, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.label = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.label = ::core::default::Default::default();
self.confidence = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for TagConfidence {
const PROTO_FQN: &'static str = "media.v1.TagConfidence";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for TagConfidence {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TAG_CONFIDENCE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.TagConfidence",
to_json: ::buffa::type_registry::any_to_json::<TagConfidence>,
from_json: ::buffa::type_registry::any_from_json::<TagConfidence>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SoundSource {
/// Field 1: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 2: `prominence`
#[cfg_attr(
feature = "json",
serde(
rename = "prominence",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub prominence: ::buffa::smol_str::SmolStr,
/// Field 3: `description`
#[cfg_attr(
feature = "json",
serde(
rename = "description",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub description: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SoundSource {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SoundSource")
.field("name", &self.name)
.field("prominence", &self.prominence)
.field("description", &self.description)
.finish()
}
}
impl SoundSource {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SoundSource";
}
impl ::buffa::DefaultInstance for SoundSource {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SoundSource> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SoundSource {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SoundSource";
const FULL_NAME: &'static str = "media.v1.SoundSource";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SoundSource";
}
impl ::buffa::Message for SoundSource {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.prominence.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.prominence) as u32;
}
if !self.description.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.description) 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::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if !self.prominence.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.prominence, buf);
}
if !self.description.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.description, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.prominence = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.description = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::default::Default::default();
self.prominence = ::core::default::Default::default();
self.description = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SoundSource {
const PROTO_FQN: &'static str = "media.v1.SoundSource";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SoundSource {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SOUND_SOURCE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SoundSource",
to_json: ::buffa::type_registry::any_to_json::<SoundSource>,
from_json: ::buffa::type_registry::any_from_json::<SoundSource>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioEvent {
/// Field 1: `event_type`
#[cfg_attr(
feature = "json",
serde(
rename = "eventType",
alias = "event_type",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub event_type: ::buffa::smol_str::SmolStr,
/// Field 2: `start_ms`
#[cfg_attr(
feature = "json",
serde(
rename = "startMs",
alias = "start_ms",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub start_ms: u32,
/// Field 3: `end_ms`
#[cfg_attr(
feature = "json",
serde(
rename = "endMs",
alias = "end_ms",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub end_ms: u32,
/// Field 4: `avg_confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "avgConfidence",
alias = "avg_confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub avg_confidence: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioEvent {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioEvent")
.field("event_type", &self.event_type)
.field("start_ms", &self.start_ms)
.field("end_ms", &self.end_ms)
.field("avg_confidence", &self.avg_confidence)
.finish()
}
}
impl AudioEvent {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioEvent";
}
impl ::buffa::DefaultInstance for AudioEvent {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioEvent> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioEvent {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioEvent";
const FULL_NAME: &'static str = "media.v1.AudioEvent";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioEvent";
}
impl ::buffa::Message for AudioEvent {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.event_type.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.event_type) as u32;
}
if self.start_ms != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.start_ms) as u32;
}
if self.end_ms != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.end_ms) as u32;
}
if self.avg_confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.event_type.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.event_type, buf);
}
if self.start_ms != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.start_ms, buf);
}
if self.end_ms != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.end_ms, buf);
}
if self.avg_confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.avg_confidence, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.event_type = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.start_ms = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.end_ms = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.avg_confidence = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.event_type = ::core::default::Default::default();
self.start_ms = 0u32;
self.end_ms = 0u32;
self.avg_confidence = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioEvent {
const PROTO_FQN: &'static str = "media.v1.AudioEvent";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioEvent {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_EVENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioEvent",
to_json: ::buffa::type_registry::any_to_json::<AudioEvent>,
from_json: ::buffa::type_registry::any_from_json::<AudioEvent>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SpeakerSegment {
/// Field 1: `start_ms`
#[cfg_attr(
feature = "json",
serde(
rename = "startMs",
alias = "start_ms",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub start_ms: u32,
/// Field 2: `end_ms`
#[cfg_attr(
feature = "json",
serde(
rename = "endMs",
alias = "end_ms",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub end_ms: u32,
/// Field 3: `speaker_id`
#[cfg_attr(
feature = "json",
serde(
rename = "speakerId",
alias = "speaker_id",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub speaker_id: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SpeakerSegment {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SpeakerSegment")
.field("start_ms", &self.start_ms)
.field("end_ms", &self.end_ms)
.field("speaker_id", &self.speaker_id)
.finish()
}
}
impl SpeakerSegment {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SpeakerSegment";
}
impl ::buffa::DefaultInstance for SpeakerSegment {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SpeakerSegment> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SpeakerSegment {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SpeakerSegment";
const FULL_NAME: &'static str = "media.v1.SpeakerSegment";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SpeakerSegment";
}
impl ::buffa::Message for SpeakerSegment {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.start_ms != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.start_ms) as u32;
}
if self.end_ms != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.end_ms) as u32;
}
if self.speaker_id != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.speaker_id) 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.start_ms != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.start_ms, buf);
}
if self.end_ms != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.end_ms, buf);
}
if self.speaker_id != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.speaker_id, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.start_ms = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.end_ms = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.speaker_id = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.start_ms = 0u32;
self.end_ms = 0u32;
self.speaker_id = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SpeakerSegment {
const PROTO_FQN: &'static str = "media.v1.SpeakerSegment";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SpeakerSegment {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SPEAKER_SEGMENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SpeakerSegment",
to_json: ::buffa::type_registry::any_to_json::<SpeakerSegment>,
from_json: ::buffa::type_registry::any_from_json::<SpeakerSegment>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioTranscriptSegment {
/// Field 1: `start_ms`
#[cfg_attr(
feature = "json",
serde(
rename = "startMs",
alias = "start_ms",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub start_ms: u32,
/// Field 2: `end_ms`
#[cfg_attr(
feature = "json",
serde(
rename = "endMs",
alias = "end_ms",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub end_ms: u32,
/// Field 3: `text`
#[cfg_attr(
feature = "json",
serde(
rename = "text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub text: ::buffa::smol_str::SmolStr,
/// Field 4: `language`
#[cfg_attr(
feature = "json",
serde(
rename = "language",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub language: ::buffa::smol_str::SmolStr,
/// Field 5: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioTranscriptSegment {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioTranscriptSegment")
.field("start_ms", &self.start_ms)
.field("end_ms", &self.end_ms)
.field("text", &self.text)
.field("language", &self.language)
.field("confidence", &self.confidence)
.finish()
}
}
impl AudioTranscriptSegment {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioTranscriptSegment";
}
impl ::buffa::DefaultInstance for AudioTranscriptSegment {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioTranscriptSegment> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioTranscriptSegment {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioTranscriptSegment";
const FULL_NAME: &'static str = "media.v1.AudioTranscriptSegment";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioTranscriptSegment";
}
impl ::buffa::Message for AudioTranscriptSegment {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.start_ms != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.start_ms) as u32;
}
if self.end_ms != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.end_ms) as u32;
}
if !self.text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.text) as u32;
}
if !self.language.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.language) as u32;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.start_ms != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.start_ms, buf);
}
if self.end_ms != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.end_ms, buf);
}
if !self.text.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.text, buf);
}
if !self.language.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.language, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.start_ms = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.end_ms = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.text = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.language = ::buffa::types::decode_string_to(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.start_ms = 0u32;
self.end_ms = 0u32;
self.text = ::core::default::Default::default();
self.language = ::core::default::Default::default();
self.confidence = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioTranscriptSegment {
const PROTO_FQN: &'static str = "media.v1.AudioTranscriptSegment";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioTranscriptSegment {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_TRANSCRIPT_SEGMENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioTranscriptSegment",
to_json: ::buffa::type_registry::any_to_json::<AudioTranscriptSegment>,
from_json: ::buffa::type_registry::any_from_json::<AudioTranscriptSegment>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioChannelSpec {
/// Field 1: `index`
#[cfg_attr(
feature = "json",
serde(
rename = "index",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub index: u32,
/// Field 2: `raw_id`
#[cfg_attr(
feature = "json",
serde(
rename = "rawId",
alias = "raw_id",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub raw_id: u32,
/// Field 3: `label`
#[cfg_attr(
feature = "json",
serde(
rename = "label",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub label: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioChannelSpec {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioChannelSpec")
.field("index", &self.index)
.field("raw_id", &self.raw_id)
.field("label", &self.label)
.finish()
}
}
impl AudioChannelSpec {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioChannelSpec";
}
impl ::buffa::DefaultInstance for AudioChannelSpec {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioChannelSpec> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioChannelSpec {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioChannelSpec";
const FULL_NAME: &'static str = "media.v1.AudioChannelSpec";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioChannelSpec";
}
impl ::buffa::Message for AudioChannelSpec {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.index != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.index) as u32;
}
if self.raw_id != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.raw_id) as u32;
}
if !self.label.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.label) 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.index != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.index, buf);
}
if self.raw_id != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.raw_id, buf);
}
if !self.label.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.label, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.index = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.raw_id = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.label = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.index = 0u32;
self.raw_id = 0u32;
self.label = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioChannelSpec {
const PROTO_FQN: &'static str = "media.v1.AudioChannelSpec";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioChannelSpec {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_CHANNEL_SPEC_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioChannelSpec",
to_json: ::buffa::type_registry::any_to_json::<AudioChannelSpec>,
from_json: ::buffa::type_registry::any_from_json::<AudioChannelSpec>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Chromaprint {
/// Field 1: `fingerprint`
#[cfg_attr(
feature = "json",
serde(
rename = "fingerprint",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub fingerprint: ::buffa::bytes::Bytes,
/// Field 2: `fingerprint_duration`
#[cfg_attr(
feature = "json",
serde(
rename = "fingerprintDuration",
alias = "fingerprint_duration",
with = "::buffa::json_helpers::double",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f64"
)
)]
pub fingerprint_duration: f64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Chromaprint {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Chromaprint")
.field("fingerprint", &self.fingerprint)
.field("fingerprint_duration", &self.fingerprint_duration)
.finish()
}
}
impl Chromaprint {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Chromaprint";
}
impl ::buffa::DefaultInstance for Chromaprint {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Chromaprint> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Chromaprint {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Chromaprint";
const FULL_NAME: &'static str = "media.v1.Chromaprint";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Chromaprint";
}
impl ::buffa::Message for Chromaprint {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.fingerprint.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.fingerprint) as u32;
}
if self.fingerprint_duration.to_bits() != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_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.fingerprint.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.fingerprint, buf);
}
if self.fingerprint_duration.to_bits() != 0u64 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed64)
.encode(buf);
::buffa::types::encode_double(self.fingerprint_duration, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.fingerprint = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 1u8,
actual: tag.wire_type() as u8,
});
}
self.fingerprint_duration = ::buffa::types::decode_double(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.fingerprint = ::buffa::bytes::Bytes::new();
self.fingerprint_duration = 0f64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Chromaprint {
const PROTO_FQN: &'static str = "media.v1.Chromaprint";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Chromaprint {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __CHROMAPRINT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Chromaprint",
to_json: ::buffa::type_registry::any_to_json::<Chromaprint>,
from_json: ::buffa::type_registry::any_from_json::<Chromaprint>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Ebur128 {
/// Field 1: `loudness_lufs`
#[cfg_attr(
feature = "json",
serde(
rename = "loudnessLufs",
alias = "loudness_lufs",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub loudness_lufs: f32,
/// Field 2: `loudness_range_lu`
#[cfg_attr(
feature = "json",
serde(
rename = "loudnessRangeLu",
alias = "loudness_range_lu",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub loudness_range_lu: f32,
/// Field 3: `true_peak_dbtp`
#[cfg_attr(
feature = "json",
serde(
rename = "truePeakDbtp",
alias = "true_peak_dbtp",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub true_peak_dbtp: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Ebur128 {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Ebur128")
.field("loudness_lufs", &self.loudness_lufs)
.field("loudness_range_lu", &self.loudness_range_lu)
.field("true_peak_dbtp", &self.true_peak_dbtp)
.finish()
}
}
impl Ebur128 {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Ebur128";
}
impl ::buffa::DefaultInstance for Ebur128 {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Ebur128> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Ebur128 {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Ebur128";
const FULL_NAME: &'static str = "media.v1.Ebur128";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Ebur128";
}
impl ::buffa::Message for Ebur128 {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.loudness_lufs.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.loudness_range_lu.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.true_peak_dbtp.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.loudness_lufs.to_bits() != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.loudness_lufs, buf);
}
if self.loudness_range_lu.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.loudness_range_lu, buf);
}
if self.true_peak_dbtp.to_bits() != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.true_peak_dbtp, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.loudness_lufs = ::buffa::types::decode_float(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.loudness_range_lu = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.true_peak_dbtp = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.loudness_lufs = 0f32;
self.loudness_range_lu = 0f32;
self.true_peak_dbtp = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Ebur128 {
const PROTO_FQN: &'static str = "media.v1.Ebur128";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Ebur128 {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __EBUR128_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Ebur128",
to_json: ::buffa::type_registry::any_to_json::<Ebur128>,
from_json: ::buffa::type_registry::any_from_json::<Ebur128>,
is_wkt: false,
};
/// ReplayGain 2.0 — container-tagged loudness-normalization recommendation
/// (FFmpeg `AV_PKT_DATA_REPLAYGAIN` side data or `REPLAYGAIN_TRACK_*` /
/// `REPLAYGAIN_ALBUM_*` `AVDictionary` keys). Distinct from `Ebur128`
/// (the EBU R128 *measurement* of the signal); ReplayGain is the
/// *delta* a tagger wrote in (delta from a -18 LUFS reference).
///
/// `track_gain_db` / `track_peak` use proto3 zero-elision (default is
/// all-zero == proto-zero for f32). `album_gain_db` / `album_peak` are
/// `optional float` so a distribution-absent album-level number
/// round-trips as `None` (wire field absent rather than zero).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ReplayGain {
/// Field 1: `track_gain_db`
#[cfg_attr(
feature = "json",
serde(
rename = "trackGainDb",
alias = "track_gain_db",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub track_gain_db: f32,
/// Field 2: `track_peak`
#[cfg_attr(
feature = "json",
serde(
rename = "trackPeak",
alias = "track_peak",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub track_peak: f32,
/// Field 3: `album_gain_db`
#[cfg_attr(
feature = "json",
serde(
rename = "albumGainDb",
alias = "album_gain_db",
with = "::buffa::json_helpers::opt_float",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub album_gain_db: ::core::option::Option<f32>,
/// Field 4: `album_peak`
#[cfg_attr(
feature = "json",
serde(
rename = "albumPeak",
alias = "album_peak",
with = "::buffa::json_helpers::opt_float",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub album_peak: ::core::option::Option<f32>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ReplayGain {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ReplayGain")
.field("track_gain_db", &self.track_gain_db)
.field("track_peak", &self.track_peak)
.field("album_gain_db", &self.album_gain_db)
.field("album_peak", &self.album_peak)
.finish()
}
}
impl ReplayGain {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ReplayGain";
}
impl ReplayGain {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::album_gain_db`] to `Some(value)`, consuming and returning `self`.
pub fn with_album_gain_db(mut self, value: f32) -> Self {
self.album_gain_db = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::album_peak`] to `Some(value)`, consuming and returning `self`.
pub fn with_album_peak(mut self, value: f32) -> Self {
self.album_peak = Some(value);
self
}
}
impl ::buffa::DefaultInstance for ReplayGain {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ReplayGain> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ReplayGain {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ReplayGain";
const FULL_NAME: &'static str = "media.v1.ReplayGain";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ReplayGain";
}
impl ::buffa::Message for ReplayGain {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.track_gain_db.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.track_peak.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.album_gain_db.is_some() {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.album_peak.is_some() {
size += 1u32 + ::buffa::types::FIXED32_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.track_gain_db.to_bits() != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.track_gain_db, buf);
}
if self.track_peak.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.track_peak, buf);
}
if let Some(v) = self.album_gain_db {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(v, buf);
}
if let Some(v) = self.album_peak {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.track_gain_db = ::buffa::types::decode_float(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.track_peak = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.album_gain_db = ::core::option::Option::Some(
::buffa::types::decode_float(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.album_peak = ::core::option::Option::Some(
::buffa::types::decode_float(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.track_gain_db = 0f32;
self.track_peak = 0f32;
self.album_gain_db = ::core::option::Option::None;
self.album_peak = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ReplayGain {
const PROTO_FQN: &'static str = "media.v1.ReplayGain";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ReplayGain {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __REPLAY_GAIN_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ReplayGain",
to_json: ::buffa::type_registry::any_to_json::<ReplayGain>,
from_json: ::buffa::type_registry::any_from_json::<ReplayGain>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Timecode {
/// Field 1: `start`
#[cfg_attr(
feature = "json",
serde(
rename = "start",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub start: ::buffa::smol_str::SmolStr,
/// Field 2: `end`
#[cfg_attr(
feature = "json",
serde(
rename = "end",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub end: ::buffa::smol_str::SmolStr,
/// Field 3: `fps`
#[cfg_attr(
feature = "json",
serde(
rename = "fps",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub fps: f32,
/// Field 4: `drop_frame`
#[cfg_attr(
feature = "json",
serde(
rename = "dropFrame",
alias = "drop_frame",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub drop_frame: bool,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Timecode {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Timecode")
.field("start", &self.start)
.field("end", &self.end)
.field("fps", &self.fps)
.field("drop_frame", &self.drop_frame)
.finish()
}
}
impl Timecode {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Timecode";
}
impl ::buffa::DefaultInstance for Timecode {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Timecode> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Timecode {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Timecode";
const FULL_NAME: &'static str = "media.v1.Timecode";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Timecode";
}
impl ::buffa::Message for Timecode {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.start.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.start) as u32;
}
if !self.end.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.end) as u32;
}
if self.fps.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.drop_frame {
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.start.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.start, buf);
}
if !self.end.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.end, buf);
}
if self.fps.to_bits() != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.fps, buf);
}
if self.drop_frame {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.drop_frame, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.start = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.end = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.fps = ::buffa::types::decode_float(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.drop_frame = ::buffa::types::decode_bool(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.start = ::core::default::Default::default();
self.end = ::core::default::Default::default();
self.fps = 0f32;
self.drop_frame = false;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Timecode {
const PROTO_FQN: &'static str = "media.v1.Timecode";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Timecode {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TIMECODE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Timecode",
to_json: ::buffa::type_registry::any_to_json::<Timecode>,
from_json: ::buffa::type_registry::any_from_json::<Timecode>,
is_wkt: false,
};
/// `tag` is the src `CedTag` u64 newtype inlined as fixed64 (wire
/// SixtyFourBit, §6.2/§6.8 #4) — soundevents dataset code.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct CedDetection {
/// Field 1: `tag`
#[cfg_attr(
feature = "json",
serde(
rename = "tag",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub tag: u64,
/// Field 2: `confidence`
#[cfg_attr(
feature = "json",
serde(
rename = "confidence",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub confidence: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CedDetection {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CedDetection")
.field("tag", &self.tag)
.field("confidence", &self.confidence)
.finish()
}
}
impl CedDetection {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.CedDetection";
}
impl ::buffa::DefaultInstance for CedDetection {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<CedDetection> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for CedDetection {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "CedDetection";
const FULL_NAME: &'static str = "media.v1.CedDetection";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.CedDetection";
}
impl ::buffa::Message for CedDetection {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.tag != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
if self.confidence.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.tag != 0u64 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Fixed64)
.encode(buf);
::buffa::types::encode_fixed64(self.tag, buf);
}
if self.confidence.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.confidence, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 1u8,
actual: tag.wire_type() as u8,
});
}
self.tag = ::buffa::types::decode_fixed64(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.confidence = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.tag = 0u64;
self.confidence = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CedDetection {
const PROTO_FQN: &'static str = "media.v1.CedDetection";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for CedDetection {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __CED_DETECTION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.CedDetection",
to_json: ::buffa::type_registry::any_to_json::<CedDetection>,
from_json: ::buffa::type_registry::any_from_json::<CedDetection>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Ced {
/// Field 1: `tags`
#[cfg_attr(
feature = "json",
serde(
rename = "tags",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub tags: ::buffa::alloc::vec::Vec<CedDetection>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Ced {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Ced").field("tags", &self.tags).finish()
}
}
impl Ced {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Ced";
}
impl ::buffa::DefaultInstance for Ced {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Ced> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Ced {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Ced";
const FULL_NAME: &'static str = "media.v1.Ced";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Ced";
}
impl ::buffa::Message for Ced {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.tags {
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.tags {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.tags.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.tags.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Ced {
const PROTO_FQN: &'static str = "media.v1.Ced";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Ced {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __CED_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Ced",
to_json: ::buffa::type_registry::any_to_json::<Ced>,
from_json: ::buffa::type_registry::any_from_json::<Ced>,
is_wkt: false,
};
/// ── Batch 3: composite audio leaves + reuse-only wrappers (§6.5/§6.2) ────────
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioChannelLayout {
/// Field 1: `order`
#[cfg_attr(
feature = "json",
serde(
rename = "order",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub order: ::buffa::EnumValue<AudioChannelOrderKind>,
/// Field 2: `channels`
#[cfg_attr(
feature = "json",
serde(
rename = "channels",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub channels: u32,
/// Field 3: `known_kind`
#[cfg_attr(
feature = "json",
serde(
rename = "knownKind",
alias = "known_kind",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub known_kind: ::buffa::EnumValue<ChannelLayoutKind>,
/// Field 4: `native_mask`
#[cfg_attr(
feature = "json",
serde(
rename = "nativeMask",
alias = "native_mask",
with = "::buffa::json_helpers::opt_uint64",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub native_mask: ::core::option::Option<u64>,
/// Field 5: `custom_channels`
#[cfg_attr(
feature = "json",
serde(
rename = "customChannels",
alias = "custom_channels",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub custom_channels: ::buffa::alloc::vec::Vec<AudioChannelSpec>,
/// Field 6: `description`
#[cfg_attr(
feature = "json",
serde(
rename = "description",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub description: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioChannelLayout {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioChannelLayout")
.field("order", &self.order)
.field("channels", &self.channels)
.field("known_kind", &self.known_kind)
.field("native_mask", &self.native_mask)
.field("custom_channels", &self.custom_channels)
.field("description", &self.description)
.finish()
}
}
impl AudioChannelLayout {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioChannelLayout";
}
impl AudioChannelLayout {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::native_mask`] to `Some(value)`, consuming and returning `self`.
pub fn with_native_mask(mut self, value: u64) -> Self {
self.native_mask = Some(value);
self
}
}
impl ::buffa::DefaultInstance for AudioChannelLayout {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioChannelLayout> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioChannelLayout {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioChannelLayout";
const FULL_NAME: &'static str = "media.v1.AudioChannelLayout";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioChannelLayout";
}
impl ::buffa::Message for AudioChannelLayout {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.order.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.channels != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.channels) as u32;
}
{
let val = self.known_kind.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if let Some(v) = self.native_mask {
size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
}
for v in &self.custom_channels {
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;
}
if !self.description.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.description) 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.order.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.channels != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.channels, buf);
}
{
let val = self.known_kind.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if let Some(v) = self.native_mask {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(v, buf);
}
for v in &self.custom_channels {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if !self.description.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.description, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.order = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.channels = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.known_kind = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.native_mask = ::core::option::Option::Some(
::buffa::types::decode_uint64(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.custom_channels.push(elem);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.description = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.order = ::buffa::EnumValue::from(0);
self.channels = 0u32;
self.known_kind = ::buffa::EnumValue::from(0);
self.native_mask = ::core::option::Option::None;
self.custom_channels.clear();
self.description = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioChannelLayout {
const PROTO_FQN: &'static str = "media.v1.AudioChannelLayout";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioChannelLayout {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_CHANNEL_LAYOUT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioChannelLayout",
to_json: ::buffa::type_registry::any_to_json::<AudioChannelLayout>,
from_json: ::buffa::type_registry::any_from_json::<AudioChannelLayout>,
is_wkt: false,
};
/// clap.rs's 5 transparent single-Detection newtypes
/// (AudioDetection/AudioSceneDetection/AudioMoodDetection/VoiceDetection/
/// SoundEvent) are NOT emitted — each slot references Detection
/// directly (§6.2).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Clap {
/// Field 1: `audio_detection`
#[cfg_attr(
feature = "json",
serde(
rename = "audioDetection",
alias = "audio_detection",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub audio_detection: ::buffa::MessageField<Detection>,
/// Field 2: `scene`
#[cfg_attr(
feature = "json",
serde(
rename = "scene",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub scene: ::buffa::MessageField<Detection>,
/// Field 3: `mood`
#[cfg_attr(
feature = "json",
serde(
rename = "mood",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub mood: ::buffa::MessageField<Detection>,
/// Field 4: `voice`
#[cfg_attr(
feature = "json",
serde(
rename = "voice",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub voice: ::buffa::MessageField<Detection>,
/// Field 5: `sound_events`
#[cfg_attr(
feature = "json",
serde(
rename = "soundEvents",
alias = "sound_events",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub sound_events: ::buffa::alloc::vec::Vec<Detection>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Clap {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Clap")
.field("audio_detection", &self.audio_detection)
.field("scene", &self.scene)
.field("mood", &self.mood)
.field("voice", &self.voice)
.field("sound_events", &self.sound_events)
.finish()
}
}
impl Clap {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Clap";
}
impl ::buffa::DefaultInstance for Clap {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Clap> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Clap {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Clap";
const FULL_NAME: &'static str = "media.v1.Clap";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Clap";
}
impl ::buffa::Message for Clap {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.audio_detection.is_set() {
let __slot = __cache.reserve();
let inner_size = self.audio_detection.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.scene.is_set() {
let __slot = __cache.reserve();
let inner_size = self.scene.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.mood.is_set() {
let __slot = __cache.reserve();
let inner_size = self.mood.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.voice.is_set() {
let __slot = __cache.reserve();
let inner_size = self.voice.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.sound_events {
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 _;
if self.audio_detection.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.audio_detection.write_to(__cache, buf);
}
if self.scene.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.scene.write_to(__cache, buf);
}
if self.mood.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.mood.write_to(__cache, buf);
}
if self.voice.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.voice.write_to(__cache, buf);
}
for v in &self.sound_events {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.audio_detection.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.scene.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.mood.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.voice.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.sound_events.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.audio_detection = ::buffa::MessageField::none();
self.scene = ::buffa::MessageField::none();
self.mood = ::buffa::MessageField::none();
self.voice = ::buffa::MessageField::none();
self.sound_events.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Clap {
const PROTO_FQN: &'static str = "media.v1.Clap";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Clap {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __CLAP_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Clap",
to_json: ::buffa::type_registry::any_to_json::<Clap>,
from_json: ::buffa::type_registry::any_from_json::<Clap>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct TrackTag {
/// Field 1: `category`
#[cfg_attr(
feature = "json",
serde(
rename = "category",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub category: ::buffa::smol_str::SmolStr,
/// Field 2: `detections`
#[cfg_attr(
feature = "json",
serde(
rename = "detections",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub detections: ::buffa::alloc::vec::Vec<Detection>,
/// Field 3: `source`
#[cfg_attr(
feature = "json",
serde(
rename = "source",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub source: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for TrackTag {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("TrackTag")
.field("category", &self.category)
.field("detections", &self.detections)
.field("source", &self.source)
.finish()
}
}
impl TrackTag {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TrackTag";
}
impl ::buffa::DefaultInstance for TrackTag {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<TrackTag> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for TrackTag {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "TrackTag";
const FULL_NAME: &'static str = "media.v1.TrackTag";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TrackTag";
}
impl ::buffa::Message for TrackTag {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.category.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.category) as u32;
}
for v in &self.detections {
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;
}
if !self.source.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.source) 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.category.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.category, buf);
}
for v in &self.detections {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if !self.source.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.source, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.category = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.detections.push(elem);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.source = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.category = ::core::default::Default::default();
self.detections.clear();
self.source = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for TrackTag {
const PROTO_FQN: &'static str = "media.v1.TrackTag";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for TrackTag {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TRACK_TAG_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.TrackTag",
to_json: ::buffa::type_registry::any_to_json::<TrackTag>,
from_json: ::buffa::type_registry::any_from_json::<TrackTag>,
is_wkt: false,
};
/// ── Batch 4: non-audio meta blocks (§6.5 non-audio table) ───────────────────
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VideoMeta {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 3: `format`
#[cfg_attr(
feature = "json",
serde(
rename = "format",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub format: ::buffa::EnumValue<VideoFormat>,
/// Field 4: `dimensions`
#[cfg_attr(
feature = "json",
serde(
rename = "dimensions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub dimensions: ::buffa::MessageField<Dimensions>,
/// Field 5: `size`
#[cfg_attr(
feature = "json",
serde(
rename = "size",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub size: u64,
/// Field 6: `time`
#[cfg_attr(
feature = "json",
serde(
rename = "time",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub time: ::buffa::MessageField<TrackTime>,
/// Field 7: `frame_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "frameRate",
alias = "frame_rate",
with = "::buffa::json_helpers::double",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f64"
)
)]
pub frame_rate: f64,
/// Field 8: `bit_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "bitRate",
alias = "bit_rate",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub bit_rate: u64,
/// Field 9: `created_at`
#[cfg_attr(
feature = "json",
serde(
rename = "createdAt",
alias = "created_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub created_at: i64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VideoMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VideoMeta")
.field("id", &self.id)
.field("name", &self.name)
.field("format", &self.format)
.field("dimensions", &self.dimensions)
.field("size", &self.size)
.field("time", &self.time)
.field("frame_rate", &self.frame_rate)
.field("bit_rate", &self.bit_rate)
.field("created_at", &self.created_at)
.finish()
}
}
impl VideoMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VideoMeta";
}
impl ::buffa::DefaultInstance for VideoMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VideoMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VideoMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VideoMeta";
const FULL_NAME: &'static str = "media.v1.VideoMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VideoMeta";
}
impl ::buffa::Message for VideoMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
{
let val = self.format.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.dimensions.is_set() {
let __slot = __cache.reserve();
let inner_size = self.dimensions.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.size != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.size) as u32;
}
if self.time.is_set() {
let __slot = __cache.reserve();
let inner_size = self.time.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.frame_rate.to_bits() != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
if self.bit_rate != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.bit_rate) as u32;
}
if self.created_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.created_at) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
{
let val = self.format.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.dimensions.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.dimensions.write_to(__cache, buf);
}
if self.size != 0u64 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.size, buf);
}
if self.time.is_set() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.time.write_to(__cache, buf);
}
if self.frame_rate.to_bits() != 0u64 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Fixed64)
.encode(buf);
::buffa::types::encode_double(self.frame_rate, buf);
}
if self.bit_rate != 0u64 {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.bit_rate, buf);
}
if self.created_at != 0i64 {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.created_at, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.format = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.dimensions.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.size = ::buffa::types::decode_uint64(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.time.get_or_insert_default(),
buf,
depth,
)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 1u8,
actual: tag.wire_type() as u8,
});
}
self.frame_rate = ::buffa::types::decode_double(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.bit_rate = ::buffa::types::decode_uint64(buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.created_at = ::buffa::types::decode_int64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.name = ::core::default::Default::default();
self.format = ::buffa::EnumValue::from(0);
self.dimensions = ::buffa::MessageField::none();
self.size = 0u64;
self.time = ::buffa::MessageField::none();
self.frame_rate = 0f64;
self.bit_rate = 0u64;
self.created_at = 0i64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VideoMeta {
const PROTO_FQN: &'static str = "media.v1.VideoMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VideoMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VIDEO_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VideoMeta",
to_json: ::buffa::type_registry::any_to_json::<VideoMeta>,
from_json: ::buffa::type_registry::any_from_json::<VideoMeta>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VideoTrackMeta {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `ordinal`
#[cfg_attr(
feature = "json",
serde(
rename = "ordinal",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub ordinal: u32,
/// Field 3: `stream_index`
#[cfg_attr(
feature = "json",
serde(
rename = "streamIndex",
alias = "stream_index",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub stream_index: u32,
/// Field 4: `container_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "containerTrackId",
alias = "container_track_id",
with = "::buffa::json_helpers::opt_uint64",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub container_track_id: ::core::option::Option<u64>,
/// Field 5: `time`
#[cfg_attr(
feature = "json",
serde(
rename = "time",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub time: ::buffa::MessageField<TrackTime>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VideoTrackMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VideoTrackMeta")
.field("id", &self.id)
.field("ordinal", &self.ordinal)
.field("stream_index", &self.stream_index)
.field("container_track_id", &self.container_track_id)
.field("time", &self.time)
.finish()
}
}
impl VideoTrackMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VideoTrackMeta";
}
impl VideoTrackMeta {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::container_track_id`] to `Some(value)`, consuming and returning `self`.
pub fn with_container_track_id(mut self, value: u64) -> Self {
self.container_track_id = Some(value);
self
}
}
impl ::buffa::DefaultInstance for VideoTrackMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VideoTrackMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VideoTrackMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VideoTrackMeta";
const FULL_NAME: &'static str = "media.v1.VideoTrackMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VideoTrackMeta";
}
impl ::buffa::Message for VideoTrackMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if self.ordinal != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.ordinal) as u32;
}
if self.stream_index != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.stream_index) as u32;
}
if let Some(v) = self.container_track_id {
size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
}
if self.time.is_set() {
let __slot = __cache.reserve();
let inner_size = self.time.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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if self.ordinal != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.ordinal, buf);
}
if self.stream_index != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.stream_index, buf);
}
if let Some(v) = self.container_track_id {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(v, buf);
}
if self.time.is_set() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.time.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.ordinal = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.stream_index = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.container_track_id = ::core::option::Option::Some(
::buffa::types::decode_uint64(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.time.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.ordinal = 0u32;
self.stream_index = 0u32;
self.container_track_id = ::core::option::Option::None;
self.time = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VideoTrackMeta {
const PROTO_FQN: &'static str = "media.v1.VideoTrackMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VideoTrackMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VIDEO_TRACK_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VideoTrackMeta",
to_json: ::buffa::type_registry::any_to_json::<VideoTrackMeta>,
from_json: ::buffa::type_registry::any_from_json::<VideoTrackMeta>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VideoStreamMeta {
/// Field 1: `codec_id`
#[cfg_attr(
feature = "json",
serde(
rename = "codecId",
alias = "codec_id",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub codec_id: ::buffa::MessageField<CodecId>,
/// Field 2: `dimensions`
#[cfg_attr(
feature = "json",
serde(
rename = "dimensions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub dimensions: ::buffa::MessageField<Dimensions>,
/// Field 3: `total_pts`
#[cfg_attr(
feature = "json",
serde(
rename = "totalPts",
alias = "total_pts",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub total_pts: i64,
/// `AVStream.r_frame_rate` — base / real frame rate. For CFR content
/// this equals `avg_frame_rate`; for VFR they diverge.
///
/// Field 4: `frame_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "frameRate",
alias = "frame_rate",
with = "::buffa::json_helpers::double",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f64"
)
)]
pub frame_rate: f64,
/// Field 5: `bit_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "bitRate",
alias = "bit_rate",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub bit_rate: u64,
/// Field 6: `time_base`
#[cfg_attr(
feature = "json",
serde(
rename = "timeBase",
alias = "time_base",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub time_base: ::buffa::MessageField<::mediatime::Timebase>,
/// `AVStream.avg_frame_rate` — empirical average (declared / nb_frames
/// ÷ duration). Diverges from `frame_rate` on VFR content. Domain
/// rev 8.
///
/// Field 7: `avg_frame_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "avgFrameRate",
alias = "avg_frame_rate",
with = "::buffa::json_helpers::double",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f64"
)
)]
pub avg_frame_rate: f64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VideoStreamMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VideoStreamMeta")
.field("codec_id", &self.codec_id)
.field("dimensions", &self.dimensions)
.field("total_pts", &self.total_pts)
.field("frame_rate", &self.frame_rate)
.field("bit_rate", &self.bit_rate)
.field("time_base", &self.time_base)
.field("avg_frame_rate", &self.avg_frame_rate)
.finish()
}
}
impl VideoStreamMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VideoStreamMeta";
}
impl ::buffa::DefaultInstance for VideoStreamMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VideoStreamMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VideoStreamMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VideoStreamMeta";
const FULL_NAME: &'static str = "media.v1.VideoStreamMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VideoStreamMeta";
}
impl ::buffa::Message for VideoStreamMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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_id.is_set() {
let __slot = __cache.reserve();
let inner_size = self.codec_id.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.dimensions.is_set() {
let __slot = __cache.reserve();
let inner_size = self.dimensions.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.total_pts != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.total_pts) as u32;
}
if self.frame_rate.to_bits() != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
if self.bit_rate != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.bit_rate) as u32;
}
if self.time_base.is_set() {
let __slot = __cache.reserve();
let inner_size = self.time_base.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.avg_frame_rate.to_bits() != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_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_id.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.codec_id.write_to(__cache, buf);
}
if self.dimensions.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.dimensions.write_to(__cache, buf);
}
if self.total_pts != 0i64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.total_pts, buf);
}
if self.frame_rate.to_bits() != 0u64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Fixed64)
.encode(buf);
::buffa::types::encode_double(self.frame_rate, buf);
}
if self.bit_rate != 0u64 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.bit_rate, buf);
}
if self.time_base.is_set() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.time_base.write_to(__cache, buf);
}
if self.avg_frame_rate.to_bits() != 0u64 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Fixed64)
.encode(buf);
::buffa::types::encode_double(self.avg_frame_rate, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.codec_id.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.dimensions.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_pts = ::buffa::types::decode_int64(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 1u8,
actual: tag.wire_type() as u8,
});
}
self.frame_rate = ::buffa::types::decode_double(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.bit_rate = ::buffa::types::decode_uint64(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.time_base.get_or_insert_default(),
buf,
depth,
)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 1u8,
actual: tag.wire_type() as u8,
});
}
self.avg_frame_rate = ::buffa::types::decode_double(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.codec_id = ::buffa::MessageField::none();
self.dimensions = ::buffa::MessageField::none();
self.total_pts = 0i64;
self.frame_rate = 0f64;
self.bit_rate = 0u64;
self.time_base = ::buffa::MessageField::none();
self.avg_frame_rate = 0f64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VideoStreamMeta {
const PROTO_FQN: &'static str = "media.v1.VideoStreamMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VideoStreamMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VIDEO_STREAM_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VideoStreamMeta",
to_json: ::buffa::type_registry::any_to_json::<VideoStreamMeta>,
from_json: ::buffa::type_registry::any_from_json::<VideoStreamMeta>,
is_wkt: false,
};
/// Per-copy metadata `name` (field 3) and `created_at` (field 6) were
/// removed when the domain split content (`Media`) from physical copy
/// (`MediaFile`) — those concerns now live on the `MediaFile` message
/// below.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct MediaMeta {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `checksum`
#[cfg_attr(
feature = "json",
serde(
rename = "checksum",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub checksum: ::buffa::bytes::Bytes,
/// Field 3: `size`
#[cfg_attr(
feature = "json",
serde(
rename = "size",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub size: u64,
/// Field 4: `time`
#[cfg_attr(
feature = "json",
serde(
rename = "time",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub time: ::buffa::MessageField<TrackTime>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for MediaMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("MediaMeta")
.field("id", &self.id)
.field("checksum", &self.checksum)
.field("size", &self.size)
.field("time", &self.time)
.finish()
}
}
impl MediaMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.MediaMeta";
}
impl ::buffa::DefaultInstance for MediaMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<MediaMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for MediaMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "MediaMeta";
const FULL_NAME: &'static str = "media.v1.MediaMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.MediaMeta";
}
impl ::buffa::Message for MediaMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.checksum.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.checksum) as u32;
}
if self.size != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.size) as u32;
}
if self.time.is_set() {
let __slot = __cache.reserve();
let inner_size = self.time.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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.checksum.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.checksum, buf);
}
if self.size != 0u64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.size, buf);
}
if self.time.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.time.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.checksum = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.size = ::buffa::types::decode_uint64(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.time.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.checksum = ::buffa::bytes::Bytes::new();
self.size = 0u64;
self.time = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for MediaMeta {
const PROTO_FQN: &'static str = "media.v1.MediaMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for MediaMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __MEDIA_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.MediaMeta",
to_json: ::buffa::type_registry::any_to_json::<MediaMeta>,
from_json: ::buffa::type_registry::any_from_json::<MediaMeta>,
is_wkt: false,
};
/// Per-copy file record. N MediaFiles may point at one Media (same content,
/// multiple physical copies on disk). `created_at` is the filesystem birth
/// time, ms since epoch; legacy `0` sentinel = absent (the wire-decode
/// adapter collapses it to `None`). `watch_volume` is carried on the wire
/// so a single message round-trips losslessly — the bridge is 1:1 and does
/// not join WatchedLocation to re-derive the volume from `watched_location_id`.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct MediaFile {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `media_id`
#[cfg_attr(
feature = "json",
serde(
rename = "mediaId",
alias = "media_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub media_id: ::buffa::bytes::Bytes,
/// Field 3: `created_at`
#[cfg_attr(
feature = "json",
serde(
rename = "createdAt",
alias = "created_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub created_at: i64,
/// Field 4: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
/// Field 5: `watched_location_id`
#[cfg_attr(
feature = "json",
serde(
rename = "watchedLocationId",
alias = "watched_location_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub watched_location_id: ::buffa::bytes::Bytes,
/// Field 6: `watch_volume`
#[cfg_attr(
feature = "json",
serde(
rename = "watchVolume",
alias = "watch_volume",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub watch_volume: ::buffa::bytes::Bytes,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for MediaFile {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("MediaFile")
.field("id", &self.id)
.field("media_id", &self.media_id)
.field("created_at", &self.created_at)
.field("location", &self.location)
.field("watched_location_id", &self.watched_location_id)
.field("watch_volume", &self.watch_volume)
.finish()
}
}
impl MediaFile {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.MediaFile";
}
impl ::buffa::DefaultInstance for MediaFile {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<MediaFile> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for MediaFile {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "MediaFile";
const FULL_NAME: &'static str = "media.v1.MediaFile";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.MediaFile";
}
impl ::buffa::Message for MediaFile {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.media_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.media_id) as u32;
}
if self.created_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.created_at) as u32;
}
if self.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.watched_location_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.watched_location_id)
as u32;
}
if !self.watch_volume.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.watch_volume) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.media_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.media_id, buf);
}
if self.created_at != 0i64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.created_at, buf);
}
if self.location.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.write_to(__cache, buf);
}
if !self.watched_location_id.is_empty() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.watched_location_id, buf);
}
if !self.watch_volume.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.watch_volume, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.media_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.created_at = ::buffa::types::decode_int64(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.watched_location_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.watch_volume = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.media_id = ::buffa::bytes::Bytes::new();
self.created_at = 0i64;
self.location = ::buffa::MessageField::none();
self.watched_location_id = ::buffa::bytes::Bytes::new();
self.watch_volume = ::buffa::bytes::Bytes::new();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for MediaFile {
const PROTO_FQN: &'static str = "media.v1.MediaFile";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for MediaFile {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __MEDIA_FILE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.MediaFile",
to_json: ::buffa::type_registry::any_to_json::<MediaFile>,
from_json: ::buffa::type_registry::any_from_json::<MediaFile>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SceneMeta {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `video_id`
#[cfg_attr(
feature = "json",
serde(
rename = "videoId",
alias = "video_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub video_id: ::buffa::bytes::Bytes,
/// Field 3: `range`
#[cfg_attr(
feature = "json",
serde(
rename = "range",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub range: ::buffa::MessageField<::mediatime::TimeRange>,
/// Field 4: `created_at`
#[cfg_attr(
feature = "json",
serde(
rename = "createdAt",
alias = "created_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub created_at: i64,
/// Field 5: `video_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "videoTrackId",
alias = "video_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub video_track_id: ::buffa::bytes::Bytes,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SceneMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SceneMeta")
.field("id", &self.id)
.field("video_id", &self.video_id)
.field("range", &self.range)
.field("created_at", &self.created_at)
.field("video_track_id", &self.video_track_id)
.finish()
}
}
impl SceneMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SceneMeta";
}
impl ::buffa::DefaultInstance for SceneMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SceneMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SceneMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SceneMeta";
const FULL_NAME: &'static str = "media.v1.SceneMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SceneMeta";
}
impl ::buffa::Message for SceneMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.video_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.video_id) as u32;
}
if self.range.is_set() {
let __slot = __cache.reserve();
let inner_size = self.range.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.created_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.created_at) as u32;
}
if !self.video_track_id.is_empty() {
size
+= 1u32 + ::buffa::types::bytes_encoded_len(&self.video_track_id) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.video_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.video_id, buf);
}
if self.range.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.range.write_to(__cache, buf);
}
if self.created_at != 0i64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.created_at, buf);
}
if !self.video_track_id.is_empty() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.video_track_id, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.video_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.range.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.created_at = ::buffa::types::decode_int64(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.video_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.video_id = ::buffa::bytes::Bytes::new();
self.range = ::buffa::MessageField::none();
self.created_at = 0i64;
self.video_track_id = ::buffa::bytes::Bytes::new();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SceneMeta {
const PROTO_FQN: &'static str = "media.v1.SceneMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SceneMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SCENE_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SceneMeta",
to_json: ::buffa::type_registry::any_to_json::<SceneMeta>,
from_json: ::buffa::type_registry::any_from_json::<SceneMeta>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SubtitleMeta {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `created_at`
#[cfg_attr(
feature = "json",
serde(
rename = "createdAt",
alias = "created_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub created_at: i64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SubtitleMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SubtitleMeta")
.field("id", &self.id)
.field("created_at", &self.created_at)
.finish()
}
}
impl SubtitleMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubtitleMeta";
}
impl ::buffa::DefaultInstance for SubtitleMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SubtitleMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SubtitleMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SubtitleMeta";
const FULL_NAME: &'static str = "media.v1.SubtitleMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubtitleMeta";
}
impl ::buffa::Message for SubtitleMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if self.created_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.created_at) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if self.created_at != 0i64 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.created_at, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.created_at = ::buffa::types::decode_int64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.created_at = 0i64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SubtitleMeta {
const PROTO_FQN: &'static str = "media.v1.SubtitleMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SubtitleMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SUBTITLE_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SubtitleMeta",
to_json: ::buffa::type_registry::any_to_json::<SubtitleMeta>,
from_json: ::buffa::type_registry::any_from_json::<SubtitleMeta>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SubtitleTrackMeta {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `ordinal`
#[cfg_attr(
feature = "json",
serde(
rename = "ordinal",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub ordinal: u32,
/// Field 3: `stream_index`
#[cfg_attr(
feature = "json",
serde(
rename = "streamIndex",
alias = "stream_index",
with = "::buffa::json_helpers::opt_uint32",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub stream_index: ::core::option::Option<u32>,
/// Field 4: `container_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "containerTrackId",
alias = "container_track_id",
with = "::buffa::json_helpers::opt_uint64",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub container_track_id: ::core::option::Option<u64>,
/// Field 5: `time`
#[cfg_attr(
feature = "json",
serde(
rename = "time",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub time: ::buffa::MessageField<TrackTime>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SubtitleTrackMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SubtitleTrackMeta")
.field("id", &self.id)
.field("ordinal", &self.ordinal)
.field("stream_index", &self.stream_index)
.field("container_track_id", &self.container_track_id)
.field("time", &self.time)
.finish()
}
}
impl SubtitleTrackMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubtitleTrackMeta";
}
impl SubtitleTrackMeta {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::stream_index`] to `Some(value)`, consuming and returning `self`.
pub fn with_stream_index(mut self, value: u32) -> Self {
self.stream_index = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::container_track_id`] to `Some(value)`, consuming and returning `self`.
pub fn with_container_track_id(mut self, value: u64) -> Self {
self.container_track_id = Some(value);
self
}
}
impl ::buffa::DefaultInstance for SubtitleTrackMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SubtitleTrackMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SubtitleTrackMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SubtitleTrackMeta";
const FULL_NAME: &'static str = "media.v1.SubtitleTrackMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubtitleTrackMeta";
}
impl ::buffa::Message for SubtitleTrackMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if self.ordinal != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.ordinal) as u32;
}
if let Some(v) = self.stream_index {
size += 1u32 + ::buffa::types::uint32_encoded_len(v) as u32;
}
if let Some(v) = self.container_track_id {
size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
}
if self.time.is_set() {
let __slot = __cache.reserve();
let inner_size = self.time.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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if self.ordinal != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.ordinal, buf);
}
if let Some(v) = self.stream_index {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(v, buf);
}
if let Some(v) = self.container_track_id {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(v, buf);
}
if self.time.is_set() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.time.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.ordinal = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.stream_index = ::core::option::Option::Some(
::buffa::types::decode_uint32(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.container_track_id = ::core::option::Option::Some(
::buffa::types::decode_uint64(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.time.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.ordinal = 0u32;
self.stream_index = ::core::option::Option::None;
self.container_track_id = ::core::option::Option::None;
self.time = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SubtitleTrackMeta {
const PROTO_FQN: &'static str = "media.v1.SubtitleTrackMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SubtitleTrackMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SUBTITLE_TRACK_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SubtitleTrackMeta",
to_json: ::buffa::type_registry::any_to_json::<SubtitleTrackMeta>,
from_json: ::buffa::type_registry::any_from_json::<SubtitleTrackMeta>,
is_wkt: false,
};
/// Rust enum-with-data -\> message + oneof (§6.2). `kind` mirrors the src
/// discriminant: 0=Unspecified, 1=Embedded, 2=Sidecar,
/// 3=GeneratedWhisper(source_audio_track_id),
/// 4=GeneratedOcr(source_subtitle_track_id). The two id payloads are the
/// oneof arms (tags 2/3 mirror the hand-rolled wire layout).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SubtitleTrackOrigin {
/// Field 1: `kind`
#[cfg_attr(
feature = "json",
serde(
rename = "kind",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub kind: u32,
#[cfg_attr(feature = "json", serde(flatten))]
pub source: ::core::option::Option<__buffa::oneof::subtitle_track_origin::Source>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SubtitleTrackOrigin {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SubtitleTrackOrigin")
.field("kind", &self.kind)
.field("source", &self.source)
.finish()
}
}
impl SubtitleTrackOrigin {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubtitleTrackOrigin";
}
impl ::buffa::DefaultInstance for SubtitleTrackOrigin {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SubtitleTrackOrigin> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SubtitleTrackOrigin {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SubtitleTrackOrigin";
const FULL_NAME: &'static str = "media.v1.SubtitleTrackOrigin";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubtitleTrackOrigin";
}
impl ::buffa::Message for SubtitleTrackOrigin {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.kind != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.kind) as u32;
}
if let ::core::option::Option::Some(ref v) = self.source {
match v {
__buffa::oneof::subtitle_track_origin::Source::SourceAudioTrackId(x) => {
size += 1u32 + ::buffa::types::bytes_encoded_len(x) as u32;
}
__buffa::oneof::subtitle_track_origin::Source::SourceSubtitleTrackId(
x,
) => {
size += 1u32 + ::buffa::types::bytes_encoded_len(x) 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.kind != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.kind, buf);
}
if let ::core::option::Option::Some(ref v) = self.source {
match v {
__buffa::oneof::subtitle_track_origin::Source::SourceAudioTrackId(x) => {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(x, buf);
}
__buffa::oneof::subtitle_track_origin::Source::SourceSubtitleTrackId(
x,
) => {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(x, buf);
}
}
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.kind = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.source = ::core::option::Option::Some(
__buffa::oneof::subtitle_track_origin::Source::SourceAudioTrackId(
::buffa::types::decode_bytes_to_bytes(buf)?,
),
);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.source = ::core::option::Option::Some(
__buffa::oneof::subtitle_track_origin::Source::SourceSubtitleTrackId(
::buffa::types::decode_bytes_to_bytes(buf)?,
),
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.kind = 0u32;
self.source = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SubtitleTrackOrigin {
const PROTO_FQN: &'static str = "media.v1.SubtitleTrackOrigin";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl<'de> serde::Deserialize<'de> for SubtitleTrackOrigin {
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 = SubtitleTrackOrigin;
fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("struct SubtitleTrackOrigin")
}
#[allow(clippy::field_reassign_with_default)]
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
mut map: A,
) -> ::core::result::Result<SubtitleTrackOrigin, A::Error> {
let mut __f_kind: ::core::option::Option<u32> = None;
let mut __oneof_source: ::core::option::Option<
__buffa::oneof::subtitle_track_origin::Source,
> = None;
while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
match key.as_str() {
"kind" => {
__f_kind = Some({
struct _S;
impl<'de> serde::de::DeserializeSeed<'de> for _S {
type Value = u32;
fn deserialize<D: serde::Deserializer<'de>>(
self,
d: D,
) -> ::core::result::Result<u32, D::Error> {
::buffa::json_helpers::uint32::deserialize(d)
}
}
map.next_value_seed(_S)?
});
}
"sourceAudioTrackId" | "source_audio_track_id" => {
struct _DeserSeed;
impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
type Value = ::buffa::bytes::Bytes;
fn deserialize<D: serde::Deserializer<'de>>(
self,
d: D,
) -> ::core::result::Result<
::buffa::bytes::Bytes,
D::Error,
> {
::buffa::json_helpers::bytes::deserialize(d)
}
}
let v: ::core::option::Option<::buffa::bytes::Bytes> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
)?;
if let Some(v) = v {
if __oneof_source.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'source'",
),
);
}
__oneof_source = Some(
__buffa::oneof::subtitle_track_origin::Source::SourceAudioTrackId(
v,
),
);
}
}
"sourceSubtitleTrackId" | "source_subtitle_track_id" => {
struct _DeserSeed;
impl<'de> serde::de::DeserializeSeed<'de> for _DeserSeed {
type Value = ::buffa::bytes::Bytes;
fn deserialize<D: serde::Deserializer<'de>>(
self,
d: D,
) -> ::core::result::Result<
::buffa::bytes::Bytes,
D::Error,
> {
::buffa::json_helpers::bytes::deserialize(d)
}
}
let v: ::core::option::Option<::buffa::bytes::Bytes> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(_DeserSeed),
)?;
if let Some(v) = v {
if __oneof_source.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'source'",
),
);
}
__oneof_source = Some(
__buffa::oneof::subtitle_track_origin::Source::SourceSubtitleTrackId(
v,
),
);
}
}
_ => {
map.next_value::<serde::de::IgnoredAny>()?;
}
}
}
let mut __r = <SubtitleTrackOrigin as ::core::default::Default>::default();
if let ::core::option::Option::Some(v) = __f_kind {
__r.kind = v;
}
__r.source = __oneof_source;
Ok(__r)
}
}
d.deserialize_map(_V)
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SubtitleTrackOrigin {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SUBTITLE_TRACK_ORIGIN_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SubtitleTrackOrigin",
to_json: ::buffa::type_registry::any_to_json::<SubtitleTrackOrigin>,
from_json: ::buffa::type_registry::any_from_json::<SubtitleTrackOrigin>,
is_wkt: false,
};
pub mod subtitle_track_origin {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::subtitle_track_origin::Source;
}
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct FailedFile {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `media_id`
#[cfg_attr(
feature = "json",
serde(
rename = "mediaId",
alias = "media_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub media_id: ::buffa::bytes::Bytes,
/// Field 3: `location_id`
#[cfg_attr(
feature = "json",
serde(
rename = "locationId",
alias = "location_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub location_id: ::buffa::bytes::Bytes,
/// Field 4: `failed_at`
#[cfg_attr(
feature = "json",
serde(
rename = "failedAt",
alias = "failed_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub failed_at: i64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FailedFile {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FailedFile")
.field("id", &self.id)
.field("media_id", &self.media_id)
.field("location_id", &self.location_id)
.field("failed_at", &self.failed_at)
.finish()
}
}
impl FailedFile {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FailedFile";
}
impl ::buffa::DefaultInstance for FailedFile {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FailedFile> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for FailedFile {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "FailedFile";
const FULL_NAME: &'static str = "media.v1.FailedFile";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FailedFile";
}
impl ::buffa::Message for FailedFile {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.media_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.media_id) as u32;
}
if !self.location_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.location_id) as u32;
}
if self.failed_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.failed_at) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.media_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.media_id, buf);
}
if !self.location_id.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.location_id, buf);
}
if self.failed_at != 0i64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.failed_at, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.media_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.location_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.failed_at = ::buffa::types::decode_int64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.media_id = ::buffa::bytes::Bytes::new();
self.location_id = ::buffa::bytes::Bytes::new();
self.failed_at = 0i64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FailedFile {
const PROTO_FQN: &'static str = "media.v1.FailedFile";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for FailedFile {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __FAILED_FILE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.FailedFile",
to_json: ::buffa::type_registry::any_to_json::<FailedFile>,
from_json: ::buffa::type_registry::any_from_json::<FailedFile>,
is_wkt: false,
};
/// ── Batch 5: non-audio track/record wrappers (§6.5 non-audio table) ─────────
///
/// `index_status` bits (VideoIndexStatus, §6.4): PROBED=0x01,
/// SCENE_DETECTED=0x02, KEYFRAME_EXTRACTED=0x04, VLM_ANALYZED=0x10,
/// APPLE_VISION_ANALYZED=0x20, TEXT_EMBEDDING_FINISHED=0x40,
/// SCENE_EMBEDDING_FINISHED=0x80 (src gap at 0x08).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Video {
/// Field 1: `meta`
#[cfg_attr(
feature = "json",
serde(
rename = "meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub meta: ::buffa::MessageField<VideoMeta>,
/// Field 2: `scenes`
#[cfg_attr(
feature = "json",
serde(
rename = "scenes",
with = "::buffa::json_helpers::proto_seq",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_vec)
)]
pub scenes: ::buffa::alloc::vec::Vec<::buffa::bytes::Bytes>,
/// Field 3: `index_status`
#[cfg_attr(
feature = "json",
serde(
rename = "indexStatus",
alias = "index_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub index_status: u32,
/// Field 4: `index_error`
#[cfg_attr(
feature = "json",
serde(
rename = "indexError",
alias = "index_error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub index_error: ::buffa::MessageField<ErrorInfo>,
/// Field 5: `error_status`
#[cfg_attr(
feature = "json",
serde(
rename = "errorStatus",
alias = "error_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub error_status: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Video {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Video")
.field("meta", &self.meta)
.field("scenes", &self.scenes)
.field("index_status", &self.index_status)
.field("index_error", &self.index_error)
.field("error_status", &self.error_status)
.finish()
}
}
impl Video {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Video";
}
impl ::buffa::DefaultInstance for Video {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Video> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Video {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Video";
const FULL_NAME: &'static str = "media.v1.Video";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Video";
}
impl ::buffa::Message for Video {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.scenes {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
if self.index_status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.index_status) as u32;
}
if self.index_error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.index_error.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.error_status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.error_status) 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.meta.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.meta.write_to(__cache, buf);
}
for v in &self.scenes {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
if self.index_status != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.index_status, buf);
}
if self.index_error.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.index_error.write_to(__cache, buf);
}
if self.error_status != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.error_status, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.meta.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.scenes.push(::buffa::types::decode_bytes_to_bytes(buf)?);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.index_status = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.index_error.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.error_status = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.meta = ::buffa::MessageField::none();
self.scenes.clear();
self.index_status = 0u32;
self.index_error = ::buffa::MessageField::none();
self.error_status = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Video {
const PROTO_FQN: &'static str = "media.v1.Video";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Video {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VIDEO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Video",
to_json: ::buffa::type_registry::any_to_json::<Video>,
from_json: ::buffa::type_registry::any_from_json::<Video>,
is_wkt: false,
};
/// `disposition` bits (VideoTrackDisposition, §6.4): DEFAULT=0x1, DUB=0x2,
/// ORIGINAL=0x4, COMMENT=0x8, LYRICS=0x10, KARAOKE=0x20, FORCED=0x40,
/// HEARING_IMPAIRED=0x80, VISUAL_IMPAIRED=0x100, CLEAN_EFFECTS=0x200,
/// ATTACHED_PIC=0x400, TIMED_THUMBNAILS=0x800, NON_DIEGETIC=0x1000
/// (gap at 0x2000-0x8000), CAPTIONS=0x10000, DESCRIPTIONS=0x20000,
/// METADATA=0x40000, DEPENDENT=0x80000, STILL_IMAGE=0x100000,
/// MULTILAYER=0x200000.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VideoTrack {
/// Field 1: `meta`
#[cfg_attr(
feature = "json",
serde(
rename = "meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub meta: ::buffa::MessageField<VideoTrackMeta>,
/// Field 2: `stream`
#[cfg_attr(
feature = "json",
serde(
rename = "stream",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub stream: ::buffa::MessageField<VideoStreamMeta>,
/// Field 3: `disposition`
#[cfg_attr(
feature = "json",
serde(
rename = "disposition",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub disposition: u32,
/// Field 4: `is_primary`
#[cfg_attr(
feature = "json",
serde(
rename = "isPrimary",
alias = "is_primary",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub is_primary: bool,
/// Field 5: `auto_selected`
#[cfg_attr(
feature = "json",
serde(
rename = "autoSelected",
alias = "auto_selected",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub auto_selected: bool,
/// Field 6: `selection_reason`
#[cfg_attr(
feature = "json",
serde(
rename = "selectionReason",
alias = "selection_reason",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub selection_reason: ::buffa::smol_str::SmolStr,
/// Field 7: `video_id`
#[cfg_attr(
feature = "json",
serde(
rename = "videoId",
alias = "video_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub video_id: ::buffa::bytes::Bytes,
/// Field 8: `index_error`
#[cfg_attr(
feature = "json",
serde(
rename = "indexError",
alias = "index_error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub index_error: ::buffa::MessageField<ErrorInfo>,
/// Container `AVDictionary` entries from this stream's metadata,
/// insertion-ordered. Domain rev 8.
///
/// Field 9: `metadata`
#[cfg_attr(
feature = "json",
serde(
rename = "metadata",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub metadata: ::buffa::alloc::vec::Vec<KeyValue>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VideoTrack {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VideoTrack")
.field("meta", &self.meta)
.field("stream", &self.stream)
.field("disposition", &self.disposition)
.field("is_primary", &self.is_primary)
.field("auto_selected", &self.auto_selected)
.field("selection_reason", &self.selection_reason)
.field("video_id", &self.video_id)
.field("index_error", &self.index_error)
.field("metadata", &self.metadata)
.finish()
}
}
impl VideoTrack {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VideoTrack";
}
impl ::buffa::DefaultInstance for VideoTrack {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VideoTrack> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VideoTrack {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VideoTrack";
const FULL_NAME: &'static str = "media.v1.VideoTrack";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VideoTrack";
}
impl ::buffa::Message for VideoTrack {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.stream.is_set() {
let __slot = __cache.reserve();
let inner_size = self.stream.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.disposition != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.disposition) as u32;
}
if self.is_primary {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.auto_selected {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.selection_reason.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.selection_reason) as u32;
}
if !self.video_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.video_id) as u32;
}
if self.index_error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.index_error.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.metadata {
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 _;
if self.meta.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.meta.write_to(__cache, buf);
}
if self.stream.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.stream.write_to(__cache, buf);
}
if self.disposition != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.disposition, buf);
}
if self.is_primary {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.is_primary, buf);
}
if self.auto_selected {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.auto_selected, buf);
}
if !self.selection_reason.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.selection_reason, buf);
}
if !self.video_id.is_empty() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.video_id, buf);
}
if self.index_error.is_set() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.index_error.write_to(__cache, buf);
}
for v in &self.metadata {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.meta.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.stream.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.disposition = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.is_primary = ::buffa::types::decode_bool(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.auto_selected = ::buffa::types::decode_bool(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.selection_reason = ::buffa::types::decode_string_to(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.video_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.index_error.get_or_insert_default(),
buf,
depth,
)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.metadata.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.meta = ::buffa::MessageField::none();
self.stream = ::buffa::MessageField::none();
self.disposition = 0u32;
self.is_primary = false;
self.auto_selected = false;
self.selection_reason = ::core::default::Default::default();
self.video_id = ::buffa::bytes::Bytes::new();
self.index_error = ::buffa::MessageField::none();
self.metadata.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VideoTrack {
const PROTO_FQN: &'static str = "media.v1.VideoTrack";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VideoTrack {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VIDEO_TRACK_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VideoTrack",
to_json: ::buffa::type_registry::any_to_json::<VideoTrack>,
from_json: ::buffa::type_registry::any_from_json::<VideoTrack>,
is_wkt: false,
};
/// `index_status` bits (MediaIndexStatus, §6.4): PROBED=0x01,
/// VIDEO_INDEXED=0x02, AUDIO_INDEXED=0x04, SUBTITLE_INDEXED=0x08.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Media {
/// Field 1: `meta`
#[cfg_attr(
feature = "json",
serde(
rename = "meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub meta: ::buffa::MessageField<MediaMeta>,
/// Field 2: `kind`
#[cfg_attr(
feature = "json",
serde(
rename = "kind",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub kind: ::buffa::EnumValue<DbMediaKind>,
/// Field 3: `index_status`
#[cfg_attr(
feature = "json",
serde(
rename = "indexStatus",
alias = "index_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub index_status: u32,
/// Field 4: `index_error`
#[cfg_attr(
feature = "json",
serde(
rename = "indexError",
alias = "index_error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub index_error: ::buffa::MessageField<ErrorInfo>,
/// Field 5: `video_id`
#[cfg_attr(
feature = "json",
serde(
rename = "videoId",
alias = "video_id",
with = "::buffa::json_helpers::opt_bytes",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_opt)
)]
pub video_id: ::core::option::Option<::buffa::bytes::Bytes>,
/// Field 6: `audio_id`
#[cfg_attr(
feature = "json",
serde(
rename = "audioId",
alias = "audio_id",
with = "::buffa::json_helpers::opt_bytes",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_opt)
)]
pub audio_id: ::core::option::Option<::buffa::bytes::Bytes>,
/// Field 7: `subtitle_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleId",
alias = "subtitle_id",
with = "::buffa::json_helpers::opt_bytes",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_opt)
)]
pub subtitle_id: ::core::option::Option<::buffa::bytes::Bytes>,
/// Field 8: `error_status`
#[cfg_attr(
feature = "json",
serde(
rename = "errorStatus",
alias = "error_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub error_status: u32,
/// Field 9: `capture_date`
#[cfg_attr(
feature = "json",
serde(
rename = "captureDate",
alias = "capture_date",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub capture_date: i64,
/// Field 10: `device_make`
#[cfg_attr(
feature = "json",
serde(
rename = "deviceMake",
alias = "device_make",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub device_make: ::buffa::smol_str::SmolStr,
/// Field 11: `device_model`
#[cfg_attr(
feature = "json",
serde(
rename = "deviceModel",
alias = "device_model",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub device_model: ::buffa::smol_str::SmolStr,
/// Field 12: `gps_location`
#[cfg_attr(
feature = "json",
serde(
rename = "gpsLocation",
alias = "gps_location",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub gps_location: ::buffa::smol_str::SmolStr,
/// Verbatim `AVFormatContext.nb_streams` — total stream count from the
/// container probe, including data / attachment streams the schema
/// may not model per-track. Domain rev 11.
///
/// Field 13: `nb_streams`
#[cfg_attr(
feature = "json",
serde(
rename = "nbStreams",
alias = "nb_streams",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub nb_streams: u32,
/// Verbatim `AVFormatContext.nb_chapters` — kept symmetric with
/// `nb_streams` so a probe-without-chapter-fetch still carries the count.
/// The domain `chapters: Vec<Id>` reverse lookup is materialised by
/// joining the `Chapter` table; not on the wire here.
///
/// Field 14: `nb_chapters`
#[cfg_attr(
feature = "json",
serde(
rename = "nbChapters",
alias = "nb_chapters",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub nb_chapters: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Media {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Media")
.field("meta", &self.meta)
.field("kind", &self.kind)
.field("index_status", &self.index_status)
.field("index_error", &self.index_error)
.field("video_id", &self.video_id)
.field("audio_id", &self.audio_id)
.field("subtitle_id", &self.subtitle_id)
.field("error_status", &self.error_status)
.field("capture_date", &self.capture_date)
.field("device_make", &self.device_make)
.field("device_model", &self.device_model)
.field("gps_location", &self.gps_location)
.field("nb_streams", &self.nb_streams)
.field("nb_chapters", &self.nb_chapters)
.finish()
}
}
impl Media {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Media";
}
impl Media {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::video_id`] to `Some(value)`, consuming and returning `self`.
pub fn with_video_id(mut self, value: impl Into<::buffa::bytes::Bytes>) -> Self {
self.video_id = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::audio_id`] to `Some(value)`, consuming and returning `self`.
pub fn with_audio_id(mut self, value: impl Into<::buffa::bytes::Bytes>) -> Self {
self.audio_id = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::subtitle_id`] to `Some(value)`, consuming and returning `self`.
pub fn with_subtitle_id(mut self, value: impl Into<::buffa::bytes::Bytes>) -> Self {
self.subtitle_id = Some(value.into());
self
}
}
impl ::buffa::DefaultInstance for Media {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Media> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Media {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Media";
const FULL_NAME: &'static str = "media.v1.Media";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Media";
}
impl ::buffa::Message for Media {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
{
let val = self.kind.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.index_status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.index_status) as u32;
}
if self.index_error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.index_error.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if let Some(ref v) = self.video_id {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
if let Some(ref v) = self.audio_id {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
if let Some(ref v) = self.subtitle_id {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
if self.error_status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.error_status) as u32;
}
if self.capture_date != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.capture_date) as u32;
}
if !self.device_make.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.device_make) as u32;
}
if !self.device_model.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.device_model) as u32;
}
if !self.gps_location.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.gps_location) as u32;
}
if self.nb_streams != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.nb_streams) as u32;
}
if self.nb_chapters != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.nb_chapters) 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.meta.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.meta.write_to(__cache, buf);
}
{
let val = self.kind.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.index_status != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.index_status, buf);
}
if self.index_error.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.index_error.write_to(__cache, buf);
}
if let Some(ref v) = self.video_id {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
if let Some(ref v) = self.audio_id {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
if let Some(ref v) = self.subtitle_id {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
if self.error_status != 0u32 {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.error_status, buf);
}
if self.capture_date != 0i64 {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.capture_date, buf);
}
if !self.device_make.is_empty() {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.device_make, buf);
}
if !self.device_model.is_empty() {
::buffa::encoding::Tag::new(
11u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.device_model, buf);
}
if !self.gps_location.is_empty() {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.gps_location, buf);
}
if self.nb_streams != 0u32 {
::buffa::encoding::Tag::new(13u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.nb_streams, buf);
}
if self.nb_chapters != 0u32 {
::buffa::encoding::Tag::new(14u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.nb_chapters, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.meta.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.kind = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.index_status = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.index_error.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.video_id = ::core::option::Option::Some(
::buffa::types::decode_bytes_to_bytes(buf)?,
);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.audio_id = ::core::option::Option::Some(
::buffa::types::decode_bytes_to_bytes(buf)?,
);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_id = ::core::option::Option::Some(
::buffa::types::decode_bytes_to_bytes(buf)?,
);
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.error_status = ::buffa::types::decode_uint32(buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.capture_date = ::buffa::types::decode_int64(buf)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.device_make = ::buffa::types::decode_string_to(buf)?;
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.device_model = ::buffa::types::decode_string_to(buf)?;
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.gps_location = ::buffa::types::decode_string_to(buf)?;
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.nb_streams = ::buffa::types::decode_uint32(buf)?;
}
14u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 14u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.nb_chapters = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.meta = ::buffa::MessageField::none();
self.kind = ::buffa::EnumValue::from(0);
self.index_status = 0u32;
self.index_error = ::buffa::MessageField::none();
self.video_id = ::core::option::Option::None;
self.audio_id = ::core::option::Option::None;
self.subtitle_id = ::core::option::Option::None;
self.error_status = 0u32;
self.capture_date = 0i64;
self.device_make = ::core::default::Default::default();
self.device_model = ::core::default::Default::default();
self.gps_location = ::core::default::Default::default();
self.nb_streams = 0u32;
self.nb_chapters = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Media {
const PROTO_FQN: &'static str = "media.v1.Media";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Media {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __MEDIA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Media",
to_json: ::buffa::type_registry::any_to_json::<Media>,
from_json: ::buffa::type_registry::any_from_json::<Media>,
is_wkt: false,
};
/// One container-level chapter / cue point — `AVFormatContext.chapters[i]`.
/// See `schema/chapter.md` (rev 1).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Chapter {
/// mediaschema-native UUIDv7.
///
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// FK → `Media.id`.
///
/// Field 2: `media_id`
#[cfg_attr(
feature = "json",
serde(
rename = "mediaId",
alias = "media_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub media_id: ::buffa::bytes::Bytes,
/// Ordinal within the parent media, `0..media.nb_chapters`.
///
/// Field 3: `index`
#[cfg_attr(
feature = "json",
serde(
rename = "index",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub index: u32,
/// `AVChapter.id` verbatim (container's own id; containers reuse).
///
/// Field 4: `source_id`
#[cfg_attr(
feature = "json",
serde(
rename = "sourceId",
alias = "source_id",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub source_id: i64,
/// start..end with its own timebase (mediatime carries the `Timebase`).
///
/// Field 5: `time_range`
#[cfg_attr(
feature = "json",
serde(
rename = "timeRange",
alias = "time_range",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub time_range: ::buffa::MessageField<::mediatime::TimeRange>,
/// Conventional `metadata["title"]` value (any case), hoisted; empty =
/// absent (never `Option`).
///
/// Field 6: `title`
#[cfg_attr(
feature = "json",
serde(
rename = "title",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub title: ::buffa::smol_str::SmolStr,
/// Every remaining AVDictionary entry, insertion-ordered. The `title`
/// key (any case) is consumed into the `title` field and not repeated
/// here. `repeated` rather than `map<string, string>` because proto3
/// maps have no ordering guarantees, and AVDictionary insertion order
/// is what we need to round-trip.
///
/// Field 7: `metadata`
#[cfg_attr(
feature = "json",
serde(
rename = "metadata",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub metadata: ::buffa::alloc::vec::Vec<KeyValue>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Chapter {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Chapter")
.field("id", &self.id)
.field("media_id", &self.media_id)
.field("index", &self.index)
.field("source_id", &self.source_id)
.field("time_range", &self.time_range)
.field("title", &self.title)
.field("metadata", &self.metadata)
.finish()
}
}
impl Chapter {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Chapter";
}
impl ::buffa::DefaultInstance for Chapter {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Chapter> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Chapter {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Chapter";
const FULL_NAME: &'static str = "media.v1.Chapter";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Chapter";
}
impl ::buffa::Message for Chapter {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.media_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.media_id) as u32;
}
if self.index != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.index) as u32;
}
if self.source_id != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.source_id) as u32;
}
if self.time_range.is_set() {
let __slot = __cache.reserve();
let inner_size = self.time_range.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.title.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.title) as u32;
}
for v in &self.metadata {
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 _;
if !self.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.media_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.media_id, buf);
}
if self.index != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.index, buf);
}
if self.source_id != 0i64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.source_id, buf);
}
if self.time_range.is_set() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.time_range.write_to(__cache, buf);
}
if !self.title.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.title, buf);
}
for v in &self.metadata {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.media_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.index = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.source_id = ::buffa::types::decode_int64(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.time_range.get_or_insert_default(),
buf,
depth,
)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.title = ::buffa::types::decode_string_to(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.metadata.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.media_id = ::buffa::bytes::Bytes::new();
self.index = 0u32;
self.source_id = 0i64;
self.time_range = ::buffa::MessageField::none();
self.title = ::core::default::Default::default();
self.metadata.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Chapter {
const PROTO_FQN: &'static str = "media.v1.Chapter";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Chapter {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __CHAPTER_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Chapter",
to_json: ::buffa::type_registry::any_to_json::<Chapter>,
from_json: ::buffa::type_registry::any_from_json::<Chapter>,
is_wkt: false,
};
/// Ordered key/value pair for AVDictionary-style metadata bags
/// (`Chapter.metadata`). Position in the parent `repeated` field IS the
/// insertion ordinal — no explicit ordinal column on the wire.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct KeyValue {
/// Field 1: `key`
#[cfg_attr(
feature = "json",
serde(
rename = "key",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub key: ::buffa::smol_str::SmolStr,
/// Field 2: `value`
#[cfg_attr(
feature = "json",
serde(
rename = "value",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub value: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for KeyValue {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("KeyValue")
.field("key", &self.key)
.field("value", &self.value)
.finish()
}
}
impl KeyValue {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.KeyValue";
}
impl ::buffa::DefaultInstance for KeyValue {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<KeyValue> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for KeyValue {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "KeyValue";
const FULL_NAME: &'static str = "media.v1.KeyValue";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.KeyValue";
}
impl ::buffa::Message for KeyValue {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.key.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.key) as u32;
}
if !self.value.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.value) 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.key.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.key, buf);
}
if !self.value.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.value, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.key = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.value = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.key = ::core::default::Default::default();
self.value = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for KeyValue {
const PROTO_FQN: &'static str = "media.v1.KeyValue";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for KeyValue {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __KEY_VALUE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.KeyValue",
to_json: ::buffa::type_registry::any_to_json::<KeyValue>,
from_json: ::buffa::type_registry::any_from_json::<KeyValue>,
is_wkt: false,
};
/// `index_status` bits (SubtitleIndexStatus, §6.4): TRACKS_DISCOVERED=0x01,
/// CUES_EXTRACTED=0x02, OCR_DONE=0x04, SEARCH_INDEXED=0x08.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Subtitle {
/// Field 1: `meta`
#[cfg_attr(
feature = "json",
serde(
rename = "meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub meta: ::buffa::MessageField<SubtitleMeta>,
/// Field 2: `index_status`
#[cfg_attr(
feature = "json",
serde(
rename = "indexStatus",
alias = "index_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub index_status: u32,
/// Field 3: `index_error`
#[cfg_attr(
feature = "json",
serde(
rename = "indexError",
alias = "index_error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub index_error: ::buffa::MessageField<ErrorInfo>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Subtitle {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Subtitle")
.field("meta", &self.meta)
.field("index_status", &self.index_status)
.field("index_error", &self.index_error)
.finish()
}
}
impl Subtitle {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Subtitle";
}
impl ::buffa::DefaultInstance for Subtitle {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Subtitle> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Subtitle {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Subtitle";
const FULL_NAME: &'static str = "media.v1.Subtitle";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Subtitle";
}
impl ::buffa::Message for Subtitle {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.index_status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.index_status) as u32;
}
if self.index_error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.index_error.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.meta.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.meta.write_to(__cache, buf);
}
if self.index_status != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.index_status, buf);
}
if self.index_error.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.index_error.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.meta.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.index_status = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.index_error.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.meta = ::buffa::MessageField::none();
self.index_status = 0u32;
self.index_error = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Subtitle {
const PROTO_FQN: &'static str = "media.v1.Subtitle";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Subtitle {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SUBTITLE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Subtitle",
to_json: ::buffa::type_registry::any_to_json::<Subtitle>,
from_json: ::buffa::type_registry::any_from_json::<Subtitle>,
is_wkt: false,
};
/// `disposition` bits (SubtitleTrackDisposition, §6.4): DEFAULT=0x1, DUB=0x2,
/// ORIGINAL=0x4, COMMENT=0x8, LYRICS=0x10, KARAOKE=0x20, FORCED=0x40,
/// HEARING_IMPAIRED=0x80, VISUAL_IMPAIRED=0x100, CLEAN_EFFECTS=0x200,
/// ATTACHED_PIC=0x400, TIMED_THUMBNAILS=0x800, NON_DIEGETIC=0x1000
/// (gap at 0x2000-0x8000), CAPTIONS=0x10000, DESCRIPTIONS=0x20000,
/// METADATA=0x40000, DEPENDENT=0x80000, STILL_IMAGE=0x100000,
/// MULTILAYER=0x200000.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SubtitleTrack {
/// Field 1: `meta`
#[cfg_attr(
feature = "json",
serde(
rename = "meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub meta: ::buffa::MessageField<SubtitleTrackMeta>,
/// Field 2: `subtitle_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleId",
alias = "subtitle_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_id: ::buffa::bytes::Bytes,
/// Field 3: `origin`
#[cfg_attr(
feature = "json",
serde(
rename = "origin",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub origin: ::buffa::MessageField<SubtitleTrackOrigin>,
/// Field 4: `format`
#[cfg_attr(
feature = "json",
serde(
rename = "format",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub format: ::buffa::EnumValue<SubtitleTrackFormat>,
/// Field 5: `role`
#[cfg_attr(
feature = "json",
serde(
rename = "role",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub role: ::buffa::EnumValue<SubtitleTrackRole>,
/// Field 6: `language`
#[cfg_attr(
feature = "json",
serde(
rename = "language",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub language: ::buffa::smol_str::SmolStr,
/// Field 7: `title`
#[cfg_attr(
feature = "json",
serde(
rename = "title",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub title: ::buffa::smol_str::SmolStr,
/// Field 8: `codec_id`
#[cfg_attr(
feature = "json",
serde(
rename = "codecId",
alias = "codec_id",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub codec_id: ::buffa::MessageField<CodecId>,
/// Field 9: `disposition`
#[cfg_attr(
feature = "json",
serde(
rename = "disposition",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub disposition: u32,
/// Field 10: `is_primary`
#[cfg_attr(
feature = "json",
serde(
rename = "isPrimary",
alias = "is_primary",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub is_primary: bool,
/// Field 11: `auto_selected`
#[cfg_attr(
feature = "json",
serde(
rename = "autoSelected",
alias = "auto_selected",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub auto_selected: bool,
/// Field 12: `selection_reason`
#[cfg_attr(
feature = "json",
serde(
rename = "selectionReason",
alias = "selection_reason",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub selection_reason: ::buffa::smol_str::SmolStr,
/// Field 13: `index_error`
#[cfg_attr(
feature = "json",
serde(
rename = "indexError",
alias = "index_error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub index_error: ::buffa::MessageField<ErrorInfo>,
/// Container `AVDictionary` entries from this stream's metadata,
/// with the hoisted `title` / `language` keys consumed into the
/// dedicated columns. Insertion-ordered. Domain rev 4.
///
/// Field 14: `metadata`
#[cfg_attr(
feature = "json",
serde(
rename = "metadata",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub metadata: ::buffa::alloc::vec::Vec<KeyValue>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SubtitleTrack {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SubtitleTrack")
.field("meta", &self.meta)
.field("subtitle_id", &self.subtitle_id)
.field("origin", &self.origin)
.field("format", &self.format)
.field("role", &self.role)
.field("language", &self.language)
.field("title", &self.title)
.field("codec_id", &self.codec_id)
.field("disposition", &self.disposition)
.field("is_primary", &self.is_primary)
.field("auto_selected", &self.auto_selected)
.field("selection_reason", &self.selection_reason)
.field("index_error", &self.index_error)
.field("metadata", &self.metadata)
.finish()
}
}
impl SubtitleTrack {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubtitleTrack";
}
impl ::buffa::DefaultInstance for SubtitleTrack {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SubtitleTrack> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SubtitleTrack {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SubtitleTrack";
const FULL_NAME: &'static str = "media.v1.SubtitleTrack";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubtitleTrack";
}
impl ::buffa::Message for SubtitleTrack {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.subtitle_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.subtitle_id) as u32;
}
if self.origin.is_set() {
let __slot = __cache.reserve();
let inner_size = self.origin.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
{
let val = self.format.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
{
let val = self.role.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if !self.language.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.language) as u32;
}
if !self.title.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.title) as u32;
}
if self.codec_id.is_set() {
let __slot = __cache.reserve();
let inner_size = self.codec_id.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.disposition != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.disposition) as u32;
}
if self.is_primary {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.auto_selected {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.selection_reason.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.selection_reason) as u32;
}
if self.index_error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.index_error.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.metadata {
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 _;
if self.meta.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.meta.write_to(__cache, buf);
}
if !self.subtitle_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_id, buf);
}
if self.origin.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.origin.write_to(__cache, buf);
}
{
let val = self.format.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
{
let val = self.role.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if !self.language.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.language, buf);
}
if !self.title.is_empty() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.title, buf);
}
if self.codec_id.is_set() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.codec_id.write_to(__cache, buf);
}
if self.disposition != 0u32 {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.disposition, buf);
}
if self.is_primary {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.is_primary, buf);
}
if self.auto_selected {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.auto_selected, buf);
}
if !self.selection_reason.is_empty() {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.selection_reason, buf);
}
if self.index_error.is_set() {
::buffa::encoding::Tag::new(
13u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.index_error.write_to(__cache, buf);
}
for v in &self.metadata {
::buffa::encoding::Tag::new(
14u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.meta.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.origin.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.format = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.role = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.language = ::buffa::types::decode_string_to(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.title = ::buffa::types::decode_string_to(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.codec_id.get_or_insert_default(),
buf,
depth,
)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.disposition = ::buffa::types::decode_uint32(buf)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.is_primary = ::buffa::types::decode_bool(buf)?;
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.auto_selected = ::buffa::types::decode_bool(buf)?;
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.selection_reason = ::buffa::types::decode_string_to(buf)?;
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.index_error.get_or_insert_default(),
buf,
depth,
)?;
}
14u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 14u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.metadata.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.meta = ::buffa::MessageField::none();
self.subtitle_id = ::buffa::bytes::Bytes::new();
self.origin = ::buffa::MessageField::none();
self.format = ::buffa::EnumValue::from(0);
self.role = ::buffa::EnumValue::from(0);
self.language = ::core::default::Default::default();
self.title = ::core::default::Default::default();
self.codec_id = ::buffa::MessageField::none();
self.disposition = 0u32;
self.is_primary = false;
self.auto_selected = false;
self.selection_reason = ::core::default::Default::default();
self.index_error = ::buffa::MessageField::none();
self.metadata.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SubtitleTrack {
const PROTO_FQN: &'static str = "media.v1.SubtitleTrack";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SubtitleTrack {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SUBTITLE_TRACK_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SubtitleTrack",
to_json: ::buffa::type_registry::any_to_json::<SubtitleTrack>,
from_json: ::buffa::type_registry::any_from_json::<SubtitleTrack>,
is_wkt: false,
};
/// Polymorphic subtitle cue — base fields plus a `data` oneof carrying the
/// per-format payload (mirrors the domain `SubtitleCue<Id, D>` shape).
///
/// `kind` is the closed \[`SubtitleCueKind`\] discriminator (the per-format
/// data oneof MUST match; mismatch is rejected at the bridge). PTS only on
/// the wire — timebase lives on the parent `SubtitleTrack` (timebase-dedup).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SubtitleCue {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `subtitle_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleTrackId",
alias = "subtitle_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_track_id: ::buffa::bytes::Bytes,
/// Field 3: `ordinal`
#[cfg_attr(
feature = "json",
serde(
rename = "ordinal",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub ordinal: u64,
/// Field 4: `span_start_pts`
#[cfg_attr(
feature = "json",
serde(
rename = "spanStartPts",
alias = "span_start_pts",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub span_start_pts: i64,
/// Field 5: `span_end_pts`
#[cfg_attr(
feature = "json",
serde(
rename = "spanEndPts",
alias = "span_end_pts",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub span_end_pts: i64,
/// Field 6: `text`
#[cfg_attr(
feature = "json",
serde(
rename = "text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub text: ::buffa::smol_str::SmolStr,
/// Field 7: `kind`
#[cfg_attr(
feature = "json",
serde(
rename = "kind",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub kind: ::buffa::EnumValue<SubtitleCueKind>,
#[cfg_attr(feature = "json", serde(flatten))]
pub data: ::core::option::Option<__buffa::oneof::subtitle_cue::Data>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SubtitleCue {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SubtitleCue")
.field("id", &self.id)
.field("subtitle_track_id", &self.subtitle_track_id)
.field("ordinal", &self.ordinal)
.field("span_start_pts", &self.span_start_pts)
.field("span_end_pts", &self.span_end_pts)
.field("text", &self.text)
.field("kind", &self.kind)
.field("data", &self.data)
.finish()
}
}
impl SubtitleCue {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubtitleCue";
}
impl ::buffa::DefaultInstance for SubtitleCue {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SubtitleCue> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SubtitleCue {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SubtitleCue";
const FULL_NAME: &'static str = "media.v1.SubtitleCue";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubtitleCue";
}
impl ::buffa::Message for SubtitleCue {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.subtitle_track_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.subtitle_track_id) as u32;
}
if self.ordinal != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.ordinal) as u32;
}
if self.span_start_pts != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.span_start_pts) as u32;
}
if self.span_end_pts != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.span_end_pts) as u32;
}
if !self.text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.text) as u32;
}
{
let val = self.kind.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if let ::core::option::Option::Some(ref v) = self.data {
match v {
__buffa::oneof::subtitle_cue::Data::Srt(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::subtitle_cue::Data::Vtt(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::subtitle_cue::Data::Ass(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::subtitle_cue::Data::Lrc(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::subtitle_cue::Data::MicroDvd(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::subtitle_cue::Data::SubViewer(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::subtitle_cue::Data::Sbv(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::subtitle_cue::Data::Ttml(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::subtitle_cue::Data::Sami(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::subtitle_cue::Data::VobSub(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::subtitle_cue::Data::Pgs(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::subtitle_cue::Data::Cea608(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::subtitle_cue::Data::EbuStl(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::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 !self.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.subtitle_track_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_track_id, buf);
}
if self.ordinal != 0u64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.ordinal, buf);
}
if self.span_start_pts != 0i64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.span_start_pts, buf);
}
if self.span_end_pts != 0i64 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.span_end_pts, buf);
}
if !self.text.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.text, buf);
}
{
let val = self.kind.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if let ::core::option::Option::Some(ref v) = self.data {
match v {
__buffa::oneof::subtitle_cue::Data::Srt(x) => {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::Vtt(x) => {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::Ass(x) => {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::Lrc(x) => {
::buffa::encoding::Tag::new(
11u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::MicroDvd(x) => {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::SubViewer(x) => {
::buffa::encoding::Tag::new(
13u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::Sbv(x) => {
::buffa::encoding::Tag::new(
14u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::Ttml(x) => {
::buffa::encoding::Tag::new(
15u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::Sami(x) => {
::buffa::encoding::Tag::new(
16u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::VobSub(x) => {
::buffa::encoding::Tag::new(
17u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::Pgs(x) => {
::buffa::encoding::Tag::new(
18u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::Cea608(x) => {
::buffa::encoding::Tag::new(
19u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::subtitle_cue::Data::EbuStl(x) => {
::buffa::encoding::Tag::new(
20u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.ordinal = ::buffa::types::decode_uint64(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.span_start_pts = ::buffa::types::decode_int64(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.span_end_pts = ::buffa::types::decode_int64(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.text = ::buffa::types::decode_string_to(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.kind = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Srt(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Srt(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Vtt(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Vtt(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Ass(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Ass(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Lrc(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Lrc(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::MicroDvd(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::MicroDvd(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::SubViewer(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::SubViewer(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
14u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 14u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Sbv(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Sbv(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
15u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Ttml(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Ttml(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
16u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 16u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Sami(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Sami(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
17u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 17u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::VobSub(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::VobSub(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
18u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 18u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Pgs(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Pgs(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
19u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 19u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Cea608(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::Cea608(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
20u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::EbuStl(ref mut existing),
) = self.data
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::subtitle_cue::Data::EbuStl(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.subtitle_track_id = ::buffa::bytes::Bytes::new();
self.ordinal = 0u64;
self.span_start_pts = 0i64;
self.span_end_pts = 0i64;
self.text = ::core::default::Default::default();
self.kind = ::buffa::EnumValue::from(0);
self.data = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SubtitleCue {
const PROTO_FQN: &'static str = "media.v1.SubtitleCue";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl<'de> serde::Deserialize<'de> for SubtitleCue {
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 = SubtitleCue;
fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("struct SubtitleCue")
}
#[allow(clippy::field_reassign_with_default)]
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
mut map: A,
) -> ::core::result::Result<SubtitleCue, A::Error> {
let mut __f_id: ::core::option::Option<::buffa::bytes::Bytes> = None;
let mut __f_subtitle_track_id: ::core::option::Option<
::buffa::bytes::Bytes,
> = None;
let mut __f_ordinal: ::core::option::Option<u64> = None;
let mut __f_span_start_pts: ::core::option::Option<i64> = None;
let mut __f_span_end_pts: ::core::option::Option<i64> = None;
let mut __f_text: ::core::option::Option<::buffa::smol_str::SmolStr> = None;
let mut __f_kind: ::core::option::Option<
::buffa::EnumValue<SubtitleCueKind>,
> = None;
let mut __oneof_data: ::core::option::Option<
__buffa::oneof::subtitle_cue::Data,
> = None;
while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
match key.as_str() {
"id" => {
__f_id = Some({
struct _S;
impl<'de> serde::de::DeserializeSeed<'de> for _S {
type Value = ::buffa::bytes::Bytes;
fn deserialize<D: serde::Deserializer<'de>>(
self,
d: D,
) -> ::core::result::Result<
::buffa::bytes::Bytes,
D::Error,
> {
::buffa::json_helpers::bytes::deserialize(d)
}
}
map.next_value_seed(_S)?
});
}
"subtitleTrackId" | "subtitle_track_id" => {
__f_subtitle_track_id = Some({
struct _S;
impl<'de> serde::de::DeserializeSeed<'de> for _S {
type Value = ::buffa::bytes::Bytes;
fn deserialize<D: serde::Deserializer<'de>>(
self,
d: D,
) -> ::core::result::Result<
::buffa::bytes::Bytes,
D::Error,
> {
::buffa::json_helpers::bytes::deserialize(d)
}
}
map.next_value_seed(_S)?
});
}
"ordinal" => {
__f_ordinal = Some({
struct _S;
impl<'de> serde::de::DeserializeSeed<'de> for _S {
type Value = u64;
fn deserialize<D: serde::Deserializer<'de>>(
self,
d: D,
) -> ::core::result::Result<u64, D::Error> {
::buffa::json_helpers::uint64::deserialize(d)
}
}
map.next_value_seed(_S)?
});
}
"spanStartPts" | "span_start_pts" => {
__f_span_start_pts = Some({
struct _S;
impl<'de> serde::de::DeserializeSeed<'de> for _S {
type Value = i64;
fn deserialize<D: serde::Deserializer<'de>>(
self,
d: D,
) -> ::core::result::Result<i64, D::Error> {
::buffa::json_helpers::int64::deserialize(d)
}
}
map.next_value_seed(_S)?
});
}
"spanEndPts" | "span_end_pts" => {
__f_span_end_pts = Some({
struct _S;
impl<'de> serde::de::DeserializeSeed<'de> for _S {
type Value = i64;
fn deserialize<D: serde::Deserializer<'de>>(
self,
d: D,
) -> ::core::result::Result<i64, D::Error> {
::buffa::json_helpers::int64::deserialize(d)
}
}
map.next_value_seed(_S)?
});
}
"text" => {
__f_text = Some({
struct _S;
impl<'de> serde::de::DeserializeSeed<'de> for _S {
type Value = ::buffa::smol_str::SmolStr;
fn deserialize<D: serde::Deserializer<'de>>(
self,
d: D,
) -> ::core::result::Result<
::buffa::smol_str::SmolStr,
D::Error,
> {
::buffa::json_helpers::proto_string::deserialize(d)
}
}
map.next_value_seed(_S)?
});
}
"kind" => {
__f_kind = Some({
struct _S;
impl<'de> serde::de::DeserializeSeed<'de> for _S {
type Value = ::buffa::EnumValue<SubtitleCueKind>;
fn deserialize<D: serde::Deserializer<'de>>(
self,
d: D,
) -> ::core::result::Result<
::buffa::EnumValue<SubtitleCueKind>,
D::Error,
> {
::buffa::json_helpers::proto_enum::deserialize(d)
}
}
map.next_value_seed(_S)?
});
}
"srt" => {
let v: ::core::option::Option<SrtData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
SrtData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::Srt(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"vtt" => {
let v: ::core::option::Option<VttData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
VttData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::Vtt(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"ass" => {
let v: ::core::option::Option<AssData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
AssData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::Ass(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"lrc" => {
let v: ::core::option::Option<LrcData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
LrcData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::Lrc(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"microDvd" | "micro_dvd" => {
let v: ::core::option::Option<MicroDvdData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
MicroDvdData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::MicroDvd(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"subViewer" | "sub_viewer" => {
let v: ::core::option::Option<SubViewerData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
SubViewerData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::SubViewer(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"sbv" => {
let v: ::core::option::Option<SbvData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
SbvData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::Sbv(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"ttml" => {
let v: ::core::option::Option<TtmlData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
TtmlData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::Ttml(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"sami" => {
let v: ::core::option::Option<SamiData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
SamiData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::Sami(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"vobSub" | "vob_sub" => {
let v: ::core::option::Option<VobSubData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
VobSubData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::VobSub(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"pgs" => {
let v: ::core::option::Option<PgsData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
PgsData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::Pgs(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"cea608" | "cea_608" => {
let v: ::core::option::Option<Cea608Data> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
Cea608Data,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::Cea608(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"ebuStl" | "ebu_stl" => {
let v: ::core::option::Option<EbuStlData> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
EbuStlData,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_data.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'data'",
),
);
}
__oneof_data = Some(
__buffa::oneof::subtitle_cue::Data::EbuStl(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
_ => {
map.next_value::<serde::de::IgnoredAny>()?;
}
}
}
let mut __r = <SubtitleCue as ::core::default::Default>::default();
if let ::core::option::Option::Some(v) = __f_id {
__r.id = v;
}
if let ::core::option::Option::Some(v) = __f_subtitle_track_id {
__r.subtitle_track_id = v;
}
if let ::core::option::Option::Some(v) = __f_ordinal {
__r.ordinal = v;
}
if let ::core::option::Option::Some(v) = __f_span_start_pts {
__r.span_start_pts = v;
}
if let ::core::option::Option::Some(v) = __f_span_end_pts {
__r.span_end_pts = v;
}
if let ::core::option::Option::Some(v) = __f_text {
__r.text = v;
}
if let ::core::option::Option::Some(v) = __f_kind {
__r.kind = v;
}
__r.data = __oneof_data;
Ok(__r)
}
}
d.deserialize_map(_V)
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SubtitleCue {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SUBTITLE_CUE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SubtitleCue",
to_json: ::buffa::type_registry::any_to_json::<SubtitleCue>,
from_json: ::buffa::type_registry::any_from_json::<SubtitleCue>,
is_wkt: false,
};
pub mod subtitle_cue {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::subtitle_cue::Data;
}
/// SubRip unit marker — SRT has no per-format detail (text rides on the
/// base `SubtitleCue.text` field).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SrtData {
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SrtData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SrtData").finish()
}
}
impl SrtData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SrtData";
}
impl ::buffa::DefaultInstance for SrtData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SrtData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SrtData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SrtData";
const FULL_NAME: &'static str = "media.v1.SrtData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SrtData";
}
impl ::buffa::Message for SrtData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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;
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 _;
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SrtData {
const PROTO_FQN: &'static str = "media.v1.SrtData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SrtData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SRT_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SrtData",
to_json: ::buffa::type_registry::any_to_json::<SrtData>,
from_json: ::buffa::type_registry::any_from_json::<SrtData>,
is_wkt: false,
};
/// WebVTT per-cue payload.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VttData {
/// Field 1: `cue_identifier`
#[cfg_attr(
feature = "json",
serde(
rename = "cueIdentifier",
alias = "cue_identifier",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub cue_identifier: ::buffa::smol_str::SmolStr,
/// Field 2: `vertical`
#[cfg_attr(
feature = "json",
serde(
rename = "vertical",
with = "::buffa::json_helpers::opt_enum",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub vertical: ::core::option::Option<::buffa::EnumValue<VttVertical>>,
/// Field 3: `line_value`
#[cfg_attr(
feature = "json",
serde(
rename = "lineValue",
alias = "line_value",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub line_value: ::buffa::smol_str::SmolStr,
/// Field 4: `line_align`
#[cfg_attr(
feature = "json",
serde(
rename = "lineAlign",
alias = "line_align",
with = "::buffa::json_helpers::opt_enum",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub line_align: ::core::option::Option<::buffa::EnumValue<VttLineAlign>>,
/// Field 5: `position_value`
#[cfg_attr(
feature = "json",
serde(
rename = "positionValue",
alias = "position_value",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub position_value: ::buffa::smol_str::SmolStr,
/// Field 6: `position_align`
#[cfg_attr(
feature = "json",
serde(
rename = "positionAlign",
alias = "position_align",
with = "::buffa::json_helpers::opt_enum",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub position_align: ::core::option::Option<::buffa::EnumValue<VttPositionAlign>>,
/// Field 7: `size_value`
#[cfg_attr(
feature = "json",
serde(
rename = "sizeValue",
alias = "size_value",
with = "::buffa::json_helpers::opt_float",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub size_value: ::core::option::Option<f32>,
/// Field 8: `text_align`
#[cfg_attr(
feature = "json",
serde(
rename = "textAlign",
alias = "text_align",
with = "::buffa::json_helpers::opt_enum",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub text_align: ::core::option::Option<::buffa::EnumValue<VttTextAlign>>,
/// Field 9: `region_id`
#[cfg_attr(
feature = "json",
serde(
rename = "regionId",
alias = "region_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub region_id: ::buffa::bytes::Bytes,
/// Field 10: `voice`
#[cfg_attr(
feature = "json",
serde(
rename = "voice",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub voice: ::buffa::smol_str::SmolStr,
/// Field 11: `styled_text`
#[cfg_attr(
feature = "json",
serde(
rename = "styledText",
alias = "styled_text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub styled_text: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VttData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VttData")
.field("cue_identifier", &self.cue_identifier)
.field("vertical", &self.vertical)
.field("line_value", &self.line_value)
.field("line_align", &self.line_align)
.field("position_value", &self.position_value)
.field("position_align", &self.position_align)
.field("size_value", &self.size_value)
.field("text_align", &self.text_align)
.field("region_id", &self.region_id)
.field("voice", &self.voice)
.field("styled_text", &self.styled_text)
.finish()
}
}
impl VttData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VttData";
}
impl VttData {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::vertical`] to `Some(value)`, consuming and returning `self`.
pub fn with_vertical(
mut self,
value: impl Into<::buffa::EnumValue<VttVertical>>,
) -> Self {
self.vertical = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::line_align`] to `Some(value)`, consuming and returning `self`.
pub fn with_line_align(
mut self,
value: impl Into<::buffa::EnumValue<VttLineAlign>>,
) -> Self {
self.line_align = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::position_align`] to `Some(value)`, consuming and returning `self`.
pub fn with_position_align(
mut self,
value: impl Into<::buffa::EnumValue<VttPositionAlign>>,
) -> Self {
self.position_align = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::size_value`] to `Some(value)`, consuming and returning `self`.
pub fn with_size_value(mut self, value: f32) -> Self {
self.size_value = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::text_align`] to `Some(value)`, consuming and returning `self`.
pub fn with_text_align(
mut self,
value: impl Into<::buffa::EnumValue<VttTextAlign>>,
) -> Self {
self.text_align = Some(value.into());
self
}
}
impl ::buffa::DefaultInstance for VttData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VttData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VttData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VttData";
const FULL_NAME: &'static str = "media.v1.VttData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VttData";
}
impl ::buffa::Message for VttData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.cue_identifier.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.cue_identifier) as u32;
}
if let Some(ref v) = self.vertical {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if !self.line_value.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.line_value) as u32;
}
if let Some(ref v) = self.line_align {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if !self.position_value.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.position_value) as u32;
}
if let Some(ref v) = self.position_align {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if self.size_value.is_some() {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if let Some(ref v) = self.text_align {
size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
}
if !self.region_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.region_id) as u32;
}
if !self.voice.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.voice) as u32;
}
if !self.styled_text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.styled_text) 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.cue_identifier.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.cue_identifier, buf);
}
if let Some(ref v) = self.vertical {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if !self.line_value.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.line_value, buf);
}
if let Some(ref v) = self.line_align {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if !self.position_value.is_empty() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.position_value, buf);
}
if let Some(ref v) = self.position_align {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if let Some(v) = self.size_value {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(v, buf);
}
if let Some(ref v) = self.text_align {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v.to_i32(), buf);
}
if !self.region_id.is_empty() {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.region_id, buf);
}
if !self.voice.is_empty() {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.voice, buf);
}
if !self.styled_text.is_empty() {
::buffa::encoding::Tag::new(
11u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.styled_text, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.cue_identifier = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.vertical = ::core::option::Option::Some(
::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?),
);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.line_value = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.line_align = ::core::option::Option::Some(
::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?),
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.position_value = ::buffa::types::decode_string_to(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.position_align = ::core::option::Option::Some(
::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?),
);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.size_value = ::core::option::Option::Some(
::buffa::types::decode_float(buf)?,
);
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.text_align = ::core::option::Option::Some(
::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?),
);
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.region_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.voice = ::buffa::types::decode_string_to(buf)?;
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.styled_text = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.cue_identifier = ::core::default::Default::default();
self.vertical = ::core::option::Option::None;
self.line_value = ::core::default::Default::default();
self.line_align = ::core::option::Option::None;
self.position_value = ::core::default::Default::default();
self.position_align = ::core::option::Option::None;
self.size_value = ::core::option::Option::None;
self.text_align = ::core::option::Option::None;
self.region_id = ::buffa::bytes::Bytes::new();
self.voice = ::core::default::Default::default();
self.styled_text = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VttData {
const PROTO_FQN: &'static str = "media.v1.VttData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VttData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VTT_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VttData",
to_json: ::buffa::type_registry::any_to_json::<VttData>,
from_json: ::buffa::type_registry::any_from_json::<VttData>,
is_wkt: false,
};
/// ASS/SSA Dialogue payload.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AssData {
/// Field 1: `layer`
#[cfg_attr(
feature = "json",
serde(
rename = "layer",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub layer: i32,
/// Field 2: `style_id`
#[cfg_attr(
feature = "json",
serde(
rename = "styleId",
alias = "style_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub style_id: ::buffa::bytes::Bytes,
/// Field 3: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 4: `margin_l`
#[cfg_attr(
feature = "json",
serde(
rename = "marginL",
alias = "margin_l",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub margin_l: i32,
/// Field 5: `margin_r`
#[cfg_attr(
feature = "json",
serde(
rename = "marginR",
alias = "margin_r",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub margin_r: i32,
/// Field 6: `margin_v`
#[cfg_attr(
feature = "json",
serde(
rename = "marginV",
alias = "margin_v",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub margin_v: i32,
/// Field 7: `effect`
#[cfg_attr(
feature = "json",
serde(
rename = "effect",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub effect: ::buffa::smol_str::SmolStr,
/// Field 8: `styled_text`
#[cfg_attr(
feature = "json",
serde(
rename = "styledText",
alias = "styled_text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub styled_text: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AssData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AssData")
.field("layer", &self.layer)
.field("style_id", &self.style_id)
.field("name", &self.name)
.field("margin_l", &self.margin_l)
.field("margin_r", &self.margin_r)
.field("margin_v", &self.margin_v)
.field("effect", &self.effect)
.field("styled_text", &self.styled_text)
.finish()
}
}
impl AssData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AssData";
}
impl ::buffa::DefaultInstance for AssData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AssData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AssData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AssData";
const FULL_NAME: &'static str = "media.v1.AssData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AssData";
}
impl ::buffa::Message for AssData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.layer != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.layer) as u32;
}
if !self.style_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.style_id) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if self.margin_l != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.margin_l) as u32;
}
if self.margin_r != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.margin_r) as u32;
}
if self.margin_v != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.margin_v) as u32;
}
if !self.effect.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.effect) as u32;
}
if !self.styled_text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.styled_text) 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.layer != 0i32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.layer, buf);
}
if !self.style_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.style_id, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.margin_l != 0i32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.margin_l, buf);
}
if self.margin_r != 0i32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.margin_r, buf);
}
if self.margin_v != 0i32 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.margin_v, buf);
}
if !self.effect.is_empty() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.effect, buf);
}
if !self.styled_text.is_empty() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.styled_text, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.layer = ::buffa::types::decode_int32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.style_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.margin_l = ::buffa::types::decode_int32(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.margin_r = ::buffa::types::decode_int32(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.margin_v = ::buffa::types::decode_int32(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.effect = ::buffa::types::decode_string_to(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.styled_text = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.layer = 0i32;
self.style_id = ::buffa::bytes::Bytes::new();
self.name = ::core::default::Default::default();
self.margin_l = 0i32;
self.margin_r = 0i32;
self.margin_v = 0i32;
self.effect = ::core::default::Default::default();
self.styled_text = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AssData {
const PROTO_FQN: &'static str = "media.v1.AssData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AssData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __ASS_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AssData",
to_json: ::buffa::type_registry::any_to_json::<AssData>,
from_json: ::buffa::type_registry::any_from_json::<AssData>,
is_wkt: false,
};
/// LRC per-cue payload — `has_word_timing` flags whether companion
/// `LrcWord` rows exist for this cue.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct LrcData {
/// Field 1: `has_word_timing`
#[cfg_attr(
feature = "json",
serde(
rename = "hasWordTiming",
alias = "has_word_timing",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub has_word_timing: bool,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for LrcData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("LrcData")
.field("has_word_timing", &self.has_word_timing)
.finish()
}
}
impl LrcData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LrcData";
}
impl ::buffa::DefaultInstance for LrcData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<LrcData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for LrcData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "LrcData";
const FULL_NAME: &'static str = "media.v1.LrcData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LrcData";
}
impl ::buffa::Message for LrcData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.has_word_timing {
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.has_word_timing {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.has_word_timing, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.has_word_timing = ::buffa::types::decode_bool(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.has_word_timing = false;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for LrcData {
const PROTO_FQN: &'static str = "media.v1.LrcData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for LrcData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LRC_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.LrcData",
to_json: ::buffa::type_registry::any_to_json::<LrcData>,
from_json: ::buffa::type_registry::any_from_json::<LrcData>,
is_wkt: false,
};
/// One word of an LRC (Enhanced) cue (sibling rows of an LRC `SubtitleCue`).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct LrcWord {
/// Field 1: `subtitle_cue_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleCueId",
alias = "subtitle_cue_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_cue_id: ::buffa::bytes::Bytes,
/// Field 2: `ordinal`
#[cfg_attr(
feature = "json",
serde(
rename = "ordinal",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub ordinal: u32,
/// Field 3: `text`
#[cfg_attr(
feature = "json",
serde(
rename = "text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub text: ::buffa::smol_str::SmolStr,
/// Field 4: `start_pts`
#[cfg_attr(
feature = "json",
serde(
rename = "startPts",
alias = "start_pts",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub start_pts: i64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for LrcWord {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("LrcWord")
.field("subtitle_cue_id", &self.subtitle_cue_id)
.field("ordinal", &self.ordinal)
.field("text", &self.text)
.field("start_pts", &self.start_pts)
.finish()
}
}
impl LrcWord {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LrcWord";
}
impl ::buffa::DefaultInstance for LrcWord {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<LrcWord> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for LrcWord {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "LrcWord";
const FULL_NAME: &'static str = "media.v1.LrcWord";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LrcWord";
}
impl ::buffa::Message for LrcWord {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.subtitle_cue_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.subtitle_cue_id) as u32;
}
if self.ordinal != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.ordinal) as u32;
}
if !self.text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.text) as u32;
}
if self.start_pts != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.start_pts) 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.subtitle_cue_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_cue_id, buf);
}
if self.ordinal != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.ordinal, buf);
}
if !self.text.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.text, buf);
}
if self.start_pts != 0i64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.start_pts, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_cue_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.ordinal = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.text = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.start_pts = ::buffa::types::decode_int64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subtitle_cue_id = ::buffa::bytes::Bytes::new();
self.ordinal = 0u32;
self.text = ::core::default::Default::default();
self.start_pts = 0i64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for LrcWord {
const PROTO_FQN: &'static str = "media.v1.LrcWord";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for LrcWord {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LRC_WORD_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.LrcWord",
to_json: ::buffa::type_registry::any_to_json::<LrcWord>,
from_json: ::buffa::type_registry::any_from_json::<LrcWord>,
is_wkt: false,
};
/// Per-track WebVTT region.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VttRegion {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `subtitle_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleTrackId",
alias = "subtitle_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_track_id: ::buffa::bytes::Bytes,
/// Field 3: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 4: `width`
#[cfg_attr(
feature = "json",
serde(
rename = "width",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub width: f32,
/// Field 5: `lines`
#[cfg_attr(
feature = "json",
serde(
rename = "lines",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub lines: u32,
/// Field 6: `region_anchor_x`
#[cfg_attr(
feature = "json",
serde(
rename = "regionAnchorX",
alias = "region_anchor_x",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub region_anchor_x: f32,
/// Field 7: `region_anchor_y`
#[cfg_attr(
feature = "json",
serde(
rename = "regionAnchorY",
alias = "region_anchor_y",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub region_anchor_y: f32,
/// Field 8: `viewport_anchor_x`
#[cfg_attr(
feature = "json",
serde(
rename = "viewportAnchorX",
alias = "viewport_anchor_x",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub viewport_anchor_x: f32,
/// Field 9: `viewport_anchor_y`
#[cfg_attr(
feature = "json",
serde(
rename = "viewportAnchorY",
alias = "viewport_anchor_y",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub viewport_anchor_y: f32,
/// Field 10: `scroll_up`
#[cfg_attr(
feature = "json",
serde(
rename = "scrollUp",
alias = "scroll_up",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub scroll_up: bool,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VttRegion {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VttRegion")
.field("id", &self.id)
.field("subtitle_track_id", &self.subtitle_track_id)
.field("name", &self.name)
.field("width", &self.width)
.field("lines", &self.lines)
.field("region_anchor_x", &self.region_anchor_x)
.field("region_anchor_y", &self.region_anchor_y)
.field("viewport_anchor_x", &self.viewport_anchor_x)
.field("viewport_anchor_y", &self.viewport_anchor_y)
.field("scroll_up", &self.scroll_up)
.finish()
}
}
impl VttRegion {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VttRegion";
}
impl ::buffa::DefaultInstance for VttRegion {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VttRegion> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VttRegion {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VttRegion";
const FULL_NAME: &'static str = "media.v1.VttRegion";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VttRegion";
}
impl ::buffa::Message for VttRegion {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.subtitle_track_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.subtitle_track_id) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if self.width.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.lines != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.lines) as u32;
}
if self.region_anchor_x.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.region_anchor_y.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.viewport_anchor_x.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.viewport_anchor_y.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.scroll_up {
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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.subtitle_track_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_track_id, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.width.to_bits() != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.width, buf);
}
if self.lines != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.lines, buf);
}
if self.region_anchor_x.to_bits() != 0u32 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.region_anchor_x, buf);
}
if self.region_anchor_y.to_bits() != 0u32 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.region_anchor_y, buf);
}
if self.viewport_anchor_x.to_bits() != 0u32 {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.viewport_anchor_x, buf);
}
if self.viewport_anchor_y.to_bits() != 0u32 {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.viewport_anchor_y, buf);
}
if self.scroll_up {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.scroll_up, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.width = ::buffa::types::decode_float(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.lines = ::buffa::types::decode_uint32(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.region_anchor_x = ::buffa::types::decode_float(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.region_anchor_y = ::buffa::types::decode_float(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.viewport_anchor_x = ::buffa::types::decode_float(buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.viewport_anchor_y = ::buffa::types::decode_float(buf)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.scroll_up = ::buffa::types::decode_bool(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.subtitle_track_id = ::buffa::bytes::Bytes::new();
self.name = ::core::default::Default::default();
self.width = 0f32;
self.lines = 0u32;
self.region_anchor_x = 0f32;
self.region_anchor_y = 0f32;
self.viewport_anchor_x = 0f32;
self.viewport_anchor_y = 0f32;
self.scroll_up = false;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VttRegion {
const PROTO_FQN: &'static str = "media.v1.VttRegion";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VttRegion {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VTT_REGION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VttRegion",
to_json: ::buffa::type_registry::any_to_json::<VttRegion>,
from_json: ::buffa::type_registry::any_from_json::<VttRegion>,
is_wkt: false,
};
/// One WebVTT `STYLE` block of a track.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VttStyleBlock {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `subtitle_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleTrackId",
alias = "subtitle_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_track_id: ::buffa::bytes::Bytes,
/// Field 3: `ordinal`
#[cfg_attr(
feature = "json",
serde(
rename = "ordinal",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub ordinal: u32,
/// Field 4: `css_text`
#[cfg_attr(
feature = "json",
serde(
rename = "cssText",
alias = "css_text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub css_text: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VttStyleBlock {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VttStyleBlock")
.field("id", &self.id)
.field("subtitle_track_id", &self.subtitle_track_id)
.field("ordinal", &self.ordinal)
.field("css_text", &self.css_text)
.finish()
}
}
impl VttStyleBlock {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VttStyleBlock";
}
impl ::buffa::DefaultInstance for VttStyleBlock {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VttStyleBlock> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VttStyleBlock {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VttStyleBlock";
const FULL_NAME: &'static str = "media.v1.VttStyleBlock";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VttStyleBlock";
}
impl ::buffa::Message for VttStyleBlock {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.subtitle_track_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.subtitle_track_id) as u32;
}
if self.ordinal != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.ordinal) as u32;
}
if !self.css_text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.css_text) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.subtitle_track_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_track_id, buf);
}
if self.ordinal != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.ordinal, buf);
}
if !self.css_text.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.css_text, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.ordinal = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.css_text = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.subtitle_track_id = ::buffa::bytes::Bytes::new();
self.ordinal = 0u32;
self.css_text = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VttStyleBlock {
const PROTO_FQN: &'static str = "media.v1.VttStyleBlock";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VttStyleBlock {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VTT_STYLE_BLOCK_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VttStyleBlock",
to_json: ::buffa::type_registry::any_to_json::<VttStyleBlock>,
from_json: ::buffa::type_registry::any_from_json::<VttStyleBlock>,
is_wkt: false,
};
/// Per-track ASS/SSA `[V4+ Styles]` row.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AssStyle {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `subtitle_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleTrackId",
alias = "subtitle_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_track_id: ::buffa::bytes::Bytes,
/// Field 3: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 4: `fontname`
#[cfg_attr(
feature = "json",
serde(
rename = "fontname",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub fontname: ::buffa::smol_str::SmolStr,
/// Field 5: `fontsize`
#[cfg_attr(
feature = "json",
serde(
rename = "fontsize",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub fontsize: f32,
/// Field 6: `primary_colour`
#[cfg_attr(
feature = "json",
serde(
rename = "primaryColour",
alias = "primary_colour",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub primary_colour: u32,
/// Field 7: `secondary_colour`
#[cfg_attr(
feature = "json",
serde(
rename = "secondaryColour",
alias = "secondary_colour",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub secondary_colour: u32,
/// Field 8: `outline_colour`
#[cfg_attr(
feature = "json",
serde(
rename = "outlineColour",
alias = "outline_colour",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub outline_colour: u32,
/// Field 9: `back_colour`
#[cfg_attr(
feature = "json",
serde(
rename = "backColour",
alias = "back_colour",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub back_colour: u32,
/// Field 10: `bold`
#[cfg_attr(
feature = "json",
serde(
rename = "bold",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub bold: bool,
/// Field 11: `italic`
#[cfg_attr(
feature = "json",
serde(
rename = "italic",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub italic: bool,
/// Field 12: `underline`
#[cfg_attr(
feature = "json",
serde(
rename = "underline",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub underline: bool,
/// Field 13: `strikeout`
#[cfg_attr(
feature = "json",
serde(
rename = "strikeout",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub strikeout: bool,
/// Field 14: `scale_x`
#[cfg_attr(
feature = "json",
serde(
rename = "scaleX",
alias = "scale_x",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub scale_x: i32,
/// Field 15: `scale_y`
#[cfg_attr(
feature = "json",
serde(
rename = "scaleY",
alias = "scale_y",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub scale_y: i32,
/// Field 16: `spacing`
#[cfg_attr(
feature = "json",
serde(
rename = "spacing",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub spacing: i32,
/// Field 17: `angle`
#[cfg_attr(
feature = "json",
serde(
rename = "angle",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub angle: f32,
/// Field 18: `border_style`
#[cfg_attr(
feature = "json",
serde(
rename = "borderStyle",
alias = "border_style",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub border_style: i32,
/// Field 19: `outline`
#[cfg_attr(
feature = "json",
serde(
rename = "outline",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub outline: f32,
/// Field 20: `shadow`
#[cfg_attr(
feature = "json",
serde(
rename = "shadow",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub shadow: f32,
/// Field 21: `alignment`
#[cfg_attr(
feature = "json",
serde(
rename = "alignment",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub alignment: i32,
/// Field 22: `margin_l`
#[cfg_attr(
feature = "json",
serde(
rename = "marginL",
alias = "margin_l",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub margin_l: i32,
/// Field 23: `margin_r`
#[cfg_attr(
feature = "json",
serde(
rename = "marginR",
alias = "margin_r",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub margin_r: i32,
/// Field 24: `margin_v`
#[cfg_attr(
feature = "json",
serde(
rename = "marginV",
alias = "margin_v",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub margin_v: i32,
/// Field 25: `encoding`
#[cfg_attr(
feature = "json",
serde(
rename = "encoding",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub encoding: i32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AssStyle {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AssStyle")
.field("id", &self.id)
.field("subtitle_track_id", &self.subtitle_track_id)
.field("name", &self.name)
.field("fontname", &self.fontname)
.field("fontsize", &self.fontsize)
.field("primary_colour", &self.primary_colour)
.field("secondary_colour", &self.secondary_colour)
.field("outline_colour", &self.outline_colour)
.field("back_colour", &self.back_colour)
.field("bold", &self.bold)
.field("italic", &self.italic)
.field("underline", &self.underline)
.field("strikeout", &self.strikeout)
.field("scale_x", &self.scale_x)
.field("scale_y", &self.scale_y)
.field("spacing", &self.spacing)
.field("angle", &self.angle)
.field("border_style", &self.border_style)
.field("outline", &self.outline)
.field("shadow", &self.shadow)
.field("alignment", &self.alignment)
.field("margin_l", &self.margin_l)
.field("margin_r", &self.margin_r)
.field("margin_v", &self.margin_v)
.field("encoding", &self.encoding)
.finish()
}
}
impl AssStyle {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AssStyle";
}
impl ::buffa::DefaultInstance for AssStyle {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AssStyle> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AssStyle {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AssStyle";
const FULL_NAME: &'static str = "media.v1.AssStyle";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AssStyle";
}
impl ::buffa::Message for AssStyle {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.subtitle_track_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.subtitle_track_id) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.fontname.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.fontname) as u32;
}
if self.fontsize.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.primary_colour != 0u32 {
size
+= 1u32 + ::buffa::types::uint32_encoded_len(self.primary_colour) as u32;
}
if self.secondary_colour != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.secondary_colour) as u32;
}
if self.outline_colour != 0u32 {
size
+= 1u32 + ::buffa::types::uint32_encoded_len(self.outline_colour) as u32;
}
if self.back_colour != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.back_colour) as u32;
}
if self.bold {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.italic {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.underline {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.strikeout {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.scale_x != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.scale_x) as u32;
}
if self.scale_y != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.scale_y) as u32;
}
if self.spacing != 0i32 {
size += 2u32 + ::buffa::types::int32_encoded_len(self.spacing) as u32;
}
if self.angle.to_bits() != 0u32 {
size += 2u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.border_style != 0i32 {
size += 2u32 + ::buffa::types::int32_encoded_len(self.border_style) as u32;
}
if self.outline.to_bits() != 0u32 {
size += 2u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.shadow.to_bits() != 0u32 {
size += 2u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.alignment != 0i32 {
size += 2u32 + ::buffa::types::int32_encoded_len(self.alignment) as u32;
}
if self.margin_l != 0i32 {
size += 2u32 + ::buffa::types::int32_encoded_len(self.margin_l) as u32;
}
if self.margin_r != 0i32 {
size += 2u32 + ::buffa::types::int32_encoded_len(self.margin_r) as u32;
}
if self.margin_v != 0i32 {
size += 2u32 + ::buffa::types::int32_encoded_len(self.margin_v) as u32;
}
if self.encoding != 0i32 {
size += 2u32 + ::buffa::types::int32_encoded_len(self.encoding) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.subtitle_track_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_track_id, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if !self.fontname.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.fontname, buf);
}
if self.fontsize.to_bits() != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.fontsize, buf);
}
if self.primary_colour != 0u32 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.primary_colour, buf);
}
if self.secondary_colour != 0u32 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.secondary_colour, buf);
}
if self.outline_colour != 0u32 {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.outline_colour, buf);
}
if self.back_colour != 0u32 {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.back_colour, buf);
}
if self.bold {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.bold, buf);
}
if self.italic {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.italic, buf);
}
if self.underline {
::buffa::encoding::Tag::new(12u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.underline, buf);
}
if self.strikeout {
::buffa::encoding::Tag::new(13u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.strikeout, buf);
}
if self.scale_x != 0i32 {
::buffa::encoding::Tag::new(14u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.scale_x, buf);
}
if self.scale_y != 0i32 {
::buffa::encoding::Tag::new(15u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.scale_y, buf);
}
if self.spacing != 0i32 {
::buffa::encoding::Tag::new(16u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.spacing, buf);
}
if self.angle.to_bits() != 0u32 {
::buffa::encoding::Tag::new(17u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.angle, buf);
}
if self.border_style != 0i32 {
::buffa::encoding::Tag::new(18u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.border_style, buf);
}
if self.outline.to_bits() != 0u32 {
::buffa::encoding::Tag::new(19u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.outline, buf);
}
if self.shadow.to_bits() != 0u32 {
::buffa::encoding::Tag::new(20u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.shadow, buf);
}
if self.alignment != 0i32 {
::buffa::encoding::Tag::new(21u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.alignment, buf);
}
if self.margin_l != 0i32 {
::buffa::encoding::Tag::new(22u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.margin_l, buf);
}
if self.margin_r != 0i32 {
::buffa::encoding::Tag::new(23u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.margin_r, buf);
}
if self.margin_v != 0i32 {
::buffa::encoding::Tag::new(24u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.margin_v, buf);
}
if self.encoding != 0i32 {
::buffa::encoding::Tag::new(25u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.encoding, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.fontname = ::buffa::types::decode_string_to(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.fontsize = ::buffa::types::decode_float(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.primary_colour = ::buffa::types::decode_uint32(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.secondary_colour = ::buffa::types::decode_uint32(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.outline_colour = ::buffa::types::decode_uint32(buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.back_colour = ::buffa::types::decode_uint32(buf)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.bold = ::buffa::types::decode_bool(buf)?;
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.italic = ::buffa::types::decode_bool(buf)?;
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.underline = ::buffa::types::decode_bool(buf)?;
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.strikeout = ::buffa::types::decode_bool(buf)?;
}
14u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 14u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.scale_x = ::buffa::types::decode_int32(buf)?;
}
15u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.scale_y = ::buffa::types::decode_int32(buf)?;
}
16u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 16u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.spacing = ::buffa::types::decode_int32(buf)?;
}
17u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 17u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.angle = ::buffa::types::decode_float(buf)?;
}
18u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 18u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.border_style = ::buffa::types::decode_int32(buf)?;
}
19u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 19u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.outline = ::buffa::types::decode_float(buf)?;
}
20u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.shadow = ::buffa::types::decode_float(buf)?;
}
21u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 21u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.alignment = ::buffa::types::decode_int32(buf)?;
}
22u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 22u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.margin_l = ::buffa::types::decode_int32(buf)?;
}
23u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 23u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.margin_r = ::buffa::types::decode_int32(buf)?;
}
24u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 24u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.margin_v = ::buffa::types::decode_int32(buf)?;
}
25u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 25u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.encoding = ::buffa::types::decode_int32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.subtitle_track_id = ::buffa::bytes::Bytes::new();
self.name = ::core::default::Default::default();
self.fontname = ::core::default::Default::default();
self.fontsize = 0f32;
self.primary_colour = 0u32;
self.secondary_colour = 0u32;
self.outline_colour = 0u32;
self.back_colour = 0u32;
self.bold = false;
self.italic = false;
self.underline = false;
self.strikeout = false;
self.scale_x = 0i32;
self.scale_y = 0i32;
self.spacing = 0i32;
self.angle = 0f32;
self.border_style = 0i32;
self.outline = 0f32;
self.shadow = 0f32;
self.alignment = 0i32;
self.margin_l = 0i32;
self.margin_r = 0i32;
self.margin_v = 0i32;
self.encoding = 0i32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AssStyle {
const PROTO_FQN: &'static str = "media.v1.AssStyle";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AssStyle {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __ASS_STYLE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AssStyle",
to_json: ::buffa::type_registry::any_to_json::<AssStyle>,
from_json: ::buffa::type_registry::any_from_json::<AssStyle>,
is_wkt: false,
};
/// Per-track LRC header metadata. 1:1 with the parent `SubtitleTrack`.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct LrcMetadata {
/// Field 1: `subtitle_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleTrackId",
alias = "subtitle_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_track_id: ::buffa::bytes::Bytes,
/// Field 2: `title`
#[cfg_attr(
feature = "json",
serde(
rename = "title",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub title: ::buffa::smol_str::SmolStr,
/// Field 3: `artist`
#[cfg_attr(
feature = "json",
serde(
rename = "artist",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub artist: ::buffa::smol_str::SmolStr,
/// Field 4: `album`
#[cfg_attr(
feature = "json",
serde(
rename = "album",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub album: ::buffa::smol_str::SmolStr,
/// Field 5: `author`
#[cfg_attr(
feature = "json",
serde(
rename = "author",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub author: ::buffa::smol_str::SmolStr,
/// Field 6: `creator`
#[cfg_attr(
feature = "json",
serde(
rename = "creator",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub creator: ::buffa::smol_str::SmolStr,
/// Field 7: `length`
#[cfg_attr(
feature = "json",
serde(
rename = "length",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub length: ::buffa::smol_str::SmolStr,
/// Field 8: `offset_ms`
#[cfg_attr(
feature = "json",
serde(
rename = "offsetMs",
alias = "offset_ms",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub offset_ms: i32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for LrcMetadata {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("LrcMetadata")
.field("subtitle_track_id", &self.subtitle_track_id)
.field("title", &self.title)
.field("artist", &self.artist)
.field("album", &self.album)
.field("author", &self.author)
.field("creator", &self.creator)
.field("length", &self.length)
.field("offset_ms", &self.offset_ms)
.finish()
}
}
impl LrcMetadata {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LrcMetadata";
}
impl ::buffa::DefaultInstance for LrcMetadata {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<LrcMetadata> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for LrcMetadata {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "LrcMetadata";
const FULL_NAME: &'static str = "media.v1.LrcMetadata";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.LrcMetadata";
}
impl ::buffa::Message for LrcMetadata {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.subtitle_track_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.subtitle_track_id) as u32;
}
if !self.title.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.title) as u32;
}
if !self.artist.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.artist) as u32;
}
if !self.album.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.album) as u32;
}
if !self.author.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.author) as u32;
}
if !self.creator.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.creator) as u32;
}
if !self.length.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.length) as u32;
}
if self.offset_ms != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.offset_ms) 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.subtitle_track_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_track_id, buf);
}
if !self.title.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.title, buf);
}
if !self.artist.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.artist, buf);
}
if !self.album.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.album, buf);
}
if !self.author.is_empty() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.author, buf);
}
if !self.creator.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.creator, buf);
}
if !self.length.is_empty() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.length, buf);
}
if self.offset_ms != 0i32 {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.offset_ms, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.title = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.artist = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.album = ::buffa::types::decode_string_to(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.author = ::buffa::types::decode_string_to(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.creator = ::buffa::types::decode_string_to(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.length = ::buffa::types::decode_string_to(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.offset_ms = ::buffa::types::decode_int32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subtitle_track_id = ::buffa::bytes::Bytes::new();
self.title = ::core::default::Default::default();
self.artist = ::core::default::Default::default();
self.album = ::core::default::Default::default();
self.author = ::core::default::Default::default();
self.creator = ::core::default::Default::default();
self.length = ::core::default::Default::default();
self.offset_ms = 0i32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for LrcMetadata {
const PROTO_FQN: &'static str = "media.v1.LrcMetadata";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for LrcMetadata {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LRC_METADATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.LrcMetadata",
to_json: ::buffa::type_registry::any_to_json::<LrcMetadata>,
from_json: ::buffa::type_registry::any_from_json::<LrcMetadata>,
is_wkt: false,
};
/// MicroDVD per-cue payload — inline `{y:i}` codes carried verbatim.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct MicroDvdData {
/// Field 1: `styled_text`
#[cfg_attr(
feature = "json",
serde(
rename = "styledText",
alias = "styled_text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub styled_text: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for MicroDvdData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("MicroDvdData").field("styled_text", &self.styled_text).finish()
}
}
impl MicroDvdData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.MicroDvdData";
}
impl ::buffa::DefaultInstance for MicroDvdData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<MicroDvdData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for MicroDvdData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "MicroDvdData";
const FULL_NAME: &'static str = "media.v1.MicroDvdData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.MicroDvdData";
}
impl ::buffa::Message for MicroDvdData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.styled_text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.styled_text) 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.styled_text.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.styled_text, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.styled_text = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.styled_text = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for MicroDvdData {
const PROTO_FQN: &'static str = "media.v1.MicroDvdData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for MicroDvdData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __MICRO_DVD_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.MicroDvdData",
to_json: ::buffa::type_registry::any_to_json::<MicroDvdData>,
from_json: ::buffa::type_registry::any_from_json::<MicroDvdData>,
is_wkt: false,
};
/// SubViewer per-cue payload — inline `[br]`/`[b]`/`[i]`/`[u]` tags.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SubViewerData {
/// Field 1: `styled_text`
#[cfg_attr(
feature = "json",
serde(
rename = "styledText",
alias = "styled_text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub styled_text: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SubViewerData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SubViewerData").field("styled_text", &self.styled_text).finish()
}
}
impl SubViewerData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubViewerData";
}
impl ::buffa::DefaultInstance for SubViewerData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SubViewerData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SubViewerData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SubViewerData";
const FULL_NAME: &'static str = "media.v1.SubViewerData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SubViewerData";
}
impl ::buffa::Message for SubViewerData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.styled_text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.styled_text) 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.styled_text.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.styled_text, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.styled_text = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.styled_text = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SubViewerData {
const PROTO_FQN: &'static str = "media.v1.SubViewerData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SubViewerData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SUB_VIEWER_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SubViewerData",
to_json: ::buffa::type_registry::any_to_json::<SubViewerData>,
from_json: ::buffa::type_registry::any_from_json::<SubViewerData>,
is_wkt: false,
};
/// YouTube SBV unit marker — plain text rides on the base
/// `SubtitleCue.text`.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SbvData {
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SbvData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SbvData").finish()
}
}
impl SbvData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SbvData";
}
impl ::buffa::DefaultInstance for SbvData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SbvData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SbvData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SbvData";
const FULL_NAME: &'static str = "media.v1.SbvData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SbvData";
}
impl ::buffa::Message for SbvData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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;
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 _;
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SbvData {
const PROTO_FQN: &'static str = "media.v1.SbvData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SbvData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SBV_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SbvData",
to_json: ::buffa::type_registry::any_to_json::<SbvData>,
from_json: ::buffa::type_registry::any_from_json::<SbvData>,
is_wkt: false,
};
/// TTML per-cue payload. Optional FKs into per-track region / style
/// aggregates, plus the inline XML fragment.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct TtmlData {
/// Field 1: `region_id`
#[cfg_attr(
feature = "json",
serde(
rename = "regionId",
alias = "region_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub region_id: ::buffa::bytes::Bytes,
/// Field 2: `style_id`
#[cfg_attr(
feature = "json",
serde(
rename = "styleId",
alias = "style_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub style_id: ::buffa::bytes::Bytes,
/// Field 3: `xml_id`
#[cfg_attr(
feature = "json",
serde(
rename = "xmlId",
alias = "xml_id",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub xml_id: ::buffa::smol_str::SmolStr,
/// Field 4: `styled_text`
#[cfg_attr(
feature = "json",
serde(
rename = "styledText",
alias = "styled_text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub styled_text: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for TtmlData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("TtmlData")
.field("region_id", &self.region_id)
.field("style_id", &self.style_id)
.field("xml_id", &self.xml_id)
.field("styled_text", &self.styled_text)
.finish()
}
}
impl TtmlData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TtmlData";
}
impl ::buffa::DefaultInstance for TtmlData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<TtmlData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for TtmlData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "TtmlData";
const FULL_NAME: &'static str = "media.v1.TtmlData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TtmlData";
}
impl ::buffa::Message for TtmlData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.region_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.region_id) as u32;
}
if !self.style_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.style_id) as u32;
}
if !self.xml_id.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.xml_id) as u32;
}
if !self.styled_text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.styled_text) 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.region_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.region_id, buf);
}
if !self.style_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.style_id, buf);
}
if !self.xml_id.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.xml_id, buf);
}
if !self.styled_text.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.styled_text, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.region_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.style_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.xml_id = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.styled_text = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.region_id = ::buffa::bytes::Bytes::new();
self.style_id = ::buffa::bytes::Bytes::new();
self.xml_id = ::core::default::Default::default();
self.styled_text = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for TtmlData {
const PROTO_FQN: &'static str = "media.v1.TtmlData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for TtmlData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TTML_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.TtmlData",
to_json: ::buffa::type_registry::any_to_json::<TtmlData>,
from_json: ::buffa::type_registry::any_from_json::<TtmlData>,
is_wkt: false,
};
/// SAMI per-cue payload — `class_name` selects which `SamiStyle` to
/// apply; `styled_text` carries the inline HTML-like body.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SamiData {
/// Field 1: `class_name`
#[cfg_attr(
feature = "json",
serde(
rename = "className",
alias = "class_name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub class_name: ::buffa::smol_str::SmolStr,
/// Field 2: `styled_text`
#[cfg_attr(
feature = "json",
serde(
rename = "styledText",
alias = "styled_text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub styled_text: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SamiData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SamiData")
.field("class_name", &self.class_name)
.field("styled_text", &self.styled_text)
.finish()
}
}
impl SamiData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SamiData";
}
impl ::buffa::DefaultInstance for SamiData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SamiData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SamiData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SamiData";
const FULL_NAME: &'static str = "media.v1.SamiData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SamiData";
}
impl ::buffa::Message for SamiData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.class_name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.class_name) as u32;
}
if !self.styled_text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.styled_text) 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.class_name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.class_name, buf);
}
if !self.styled_text.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.styled_text, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.class_name = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.styled_text = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.class_name = ::core::default::Default::default();
self.styled_text = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SamiData {
const PROTO_FQN: &'static str = "media.v1.SamiData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SamiData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SAMI_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SamiData",
to_json: ::buffa::type_registry::any_to_json::<SamiData>,
from_json: ::buffa::type_registry::any_from_json::<SamiData>,
is_wkt: false,
};
/// Per-track TTML `<region>` element.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct TtmlRegion {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `subtitle_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleTrackId",
alias = "subtitle_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_track_id: ::buffa::bytes::Bytes,
/// Field 3: `xml_id`
#[cfg_attr(
feature = "json",
serde(
rename = "xmlId",
alias = "xml_id",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub xml_id: ::buffa::smol_str::SmolStr,
/// Field 4: `xml_attrs`
#[cfg_attr(
feature = "json",
serde(
rename = "xmlAttrs",
alias = "xml_attrs",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub xml_attrs: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for TtmlRegion {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("TtmlRegion")
.field("id", &self.id)
.field("subtitle_track_id", &self.subtitle_track_id)
.field("xml_id", &self.xml_id)
.field("xml_attrs", &self.xml_attrs)
.finish()
}
}
impl TtmlRegion {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TtmlRegion";
}
impl ::buffa::DefaultInstance for TtmlRegion {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<TtmlRegion> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for TtmlRegion {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "TtmlRegion";
const FULL_NAME: &'static str = "media.v1.TtmlRegion";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TtmlRegion";
}
impl ::buffa::Message for TtmlRegion {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.subtitle_track_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.subtitle_track_id) as u32;
}
if !self.xml_id.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.xml_id) as u32;
}
if !self.xml_attrs.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.xml_attrs) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.subtitle_track_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_track_id, buf);
}
if !self.xml_id.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.xml_id, buf);
}
if !self.xml_attrs.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.xml_attrs, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.xml_id = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.xml_attrs = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.subtitle_track_id = ::buffa::bytes::Bytes::new();
self.xml_id = ::core::default::Default::default();
self.xml_attrs = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for TtmlRegion {
const PROTO_FQN: &'static str = "media.v1.TtmlRegion";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for TtmlRegion {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TTML_REGION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.TtmlRegion",
to_json: ::buffa::type_registry::any_to_json::<TtmlRegion>,
from_json: ::buffa::type_registry::any_from_json::<TtmlRegion>,
is_wkt: false,
};
/// Per-track TTML `<style>` element.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct TtmlStyle {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `subtitle_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleTrackId",
alias = "subtitle_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_track_id: ::buffa::bytes::Bytes,
/// Field 3: `xml_id`
#[cfg_attr(
feature = "json",
serde(
rename = "xmlId",
alias = "xml_id",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub xml_id: ::buffa::smol_str::SmolStr,
/// Field 4: `xml_attrs`
#[cfg_attr(
feature = "json",
serde(
rename = "xmlAttrs",
alias = "xml_attrs",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub xml_attrs: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for TtmlStyle {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("TtmlStyle")
.field("id", &self.id)
.field("subtitle_track_id", &self.subtitle_track_id)
.field("xml_id", &self.xml_id)
.field("xml_attrs", &self.xml_attrs)
.finish()
}
}
impl TtmlStyle {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TtmlStyle";
}
impl ::buffa::DefaultInstance for TtmlStyle {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<TtmlStyle> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for TtmlStyle {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "TtmlStyle";
const FULL_NAME: &'static str = "media.v1.TtmlStyle";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TtmlStyle";
}
impl ::buffa::Message for TtmlStyle {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.subtitle_track_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.subtitle_track_id) as u32;
}
if !self.xml_id.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.xml_id) as u32;
}
if !self.xml_attrs.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.xml_attrs) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.subtitle_track_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_track_id, buf);
}
if !self.xml_id.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.xml_id, buf);
}
if !self.xml_attrs.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.xml_attrs, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.xml_id = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.xml_attrs = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.subtitle_track_id = ::buffa::bytes::Bytes::new();
self.xml_id = ::core::default::Default::default();
self.xml_attrs = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for TtmlStyle {
const PROTO_FQN: &'static str = "media.v1.TtmlStyle";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for TtmlStyle {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TTML_STYLE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.TtmlStyle",
to_json: ::buffa::type_registry::any_to_json::<TtmlStyle>,
from_json: ::buffa::type_registry::any_from_json::<TtmlStyle>,
is_wkt: false,
};
/// Per-track SAMI `<STYLE>` class.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SamiStyle {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `subtitle_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleTrackId",
alias = "subtitle_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_track_id: ::buffa::bytes::Bytes,
/// Field 3: `class_name`
#[cfg_attr(
feature = "json",
serde(
rename = "className",
alias = "class_name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub class_name: ::buffa::smol_str::SmolStr,
/// Field 4: `css_text`
#[cfg_attr(
feature = "json",
serde(
rename = "cssText",
alias = "css_text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub css_text: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SamiStyle {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SamiStyle")
.field("id", &self.id)
.field("subtitle_track_id", &self.subtitle_track_id)
.field("class_name", &self.class_name)
.field("css_text", &self.css_text)
.finish()
}
}
impl SamiStyle {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SamiStyle";
}
impl ::buffa::DefaultInstance for SamiStyle {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SamiStyle> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SamiStyle {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SamiStyle";
const FULL_NAME: &'static str = "media.v1.SamiStyle";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SamiStyle";
}
impl ::buffa::Message for SamiStyle {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.subtitle_track_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.subtitle_track_id) as u32;
}
if !self.class_name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.class_name) as u32;
}
if !self.css_text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.css_text) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.subtitle_track_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_track_id, buf);
}
if !self.class_name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.class_name, buf);
}
if !self.css_text.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.css_text, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.class_name = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.css_text = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.subtitle_track_id = ::buffa::bytes::Bytes::new();
self.class_name = ::core::default::Default::default();
self.css_text = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SamiStyle {
const PROTO_FQN: &'static str = "media.v1.SamiStyle";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SamiStyle {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SAMI_STYLE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SamiStyle",
to_json: ::buffa::type_registry::any_to_json::<SamiStyle>,
from_json: ::buffa::type_registry::any_from_json::<SamiStyle>,
is_wkt: false,
};
/// DVD VobSub per-cue payload — bitmap blob + per-cue geometry + colour
/// / contrast indices into the per-track `VobSubPalette`. The 4-entry
/// index arrays ride packed as a single fixed-32-bit field (4 × u8
/// little-endian) per arm.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VobSubData {
/// Field 1: `palette_id`
#[cfg_attr(
feature = "json",
serde(
rename = "paletteId",
alias = "palette_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub palette_id: ::buffa::bytes::Bytes,
/// Field 2: `bitmap`
#[cfg_attr(
feature = "json",
serde(
rename = "bitmap",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub bitmap: ::buffa::bytes::Bytes,
/// Field 3: `width`
#[cfg_attr(
feature = "json",
serde(
rename = "width",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub width: u32,
/// Field 4: `height`
#[cfg_attr(
feature = "json",
serde(
rename = "height",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub height: u32,
/// Field 5: `pos_x`
#[cfg_attr(
feature = "json",
serde(
rename = "posX",
alias = "pos_x",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub pos_x: i32,
/// Field 6: `pos_y`
#[cfg_attr(
feature = "json",
serde(
rename = "posY",
alias = "pos_y",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub pos_y: i32,
/// `color_indices[0..4]` packed LE: byte0|byte1\<\<8|byte2\<\<16|byte3\<\<24.
///
/// Field 7: `color_indices`
#[cfg_attr(
feature = "json",
serde(
rename = "colorIndices",
alias = "color_indices",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub color_indices: u32,
/// Same packing for the 4-entry contrast index array.
///
/// Field 8: `contrast_indices`
#[cfg_attr(
feature = "json",
serde(
rename = "contrastIndices",
alias = "contrast_indices",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub contrast_indices: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VobSubData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VobSubData")
.field("palette_id", &self.palette_id)
.field("bitmap", &self.bitmap)
.field("width", &self.width)
.field("height", &self.height)
.field("pos_x", &self.pos_x)
.field("pos_y", &self.pos_y)
.field("color_indices", &self.color_indices)
.field("contrast_indices", &self.contrast_indices)
.finish()
}
}
impl VobSubData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VobSubData";
}
impl ::buffa::DefaultInstance for VobSubData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VobSubData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VobSubData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VobSubData";
const FULL_NAME: &'static str = "media.v1.VobSubData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VobSubData";
}
impl ::buffa::Message for VobSubData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.palette_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.palette_id) as u32;
}
if !self.bitmap.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.bitmap) as u32;
}
if self.width != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.width) as u32;
}
if self.height != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.height) as u32;
}
if self.pos_x != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.pos_x) as u32;
}
if self.pos_y != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.pos_y) as u32;
}
if self.color_indices != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.color_indices) as u32;
}
if self.contrast_indices != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.contrast_indices) 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.palette_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.palette_id, buf);
}
if !self.bitmap.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.bitmap, buf);
}
if self.width != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.width, buf);
}
if self.height != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.height, buf);
}
if self.pos_x != 0i32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.pos_x, buf);
}
if self.pos_y != 0i32 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.pos_y, buf);
}
if self.color_indices != 0u32 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.color_indices, buf);
}
if self.contrast_indices != 0u32 {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.contrast_indices, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.palette_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.bitmap = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.width = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.height = ::buffa::types::decode_uint32(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.pos_x = ::buffa::types::decode_int32(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.pos_y = ::buffa::types::decode_int32(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.color_indices = ::buffa::types::decode_uint32(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.contrast_indices = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.palette_id = ::buffa::bytes::Bytes::new();
self.bitmap = ::buffa::bytes::Bytes::new();
self.width = 0u32;
self.height = 0u32;
self.pos_x = 0i32;
self.pos_y = 0i32;
self.color_indices = 0u32;
self.contrast_indices = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VobSubData {
const PROTO_FQN: &'static str = "media.v1.VobSubData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VobSubData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VOB_SUB_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VobSubData",
to_json: ::buffa::type_registry::any_to_json::<VobSubData>,
from_json: ::buffa::type_registry::any_from_json::<VobSubData>,
is_wkt: false,
};
/// Blu-ray PGS per-cue payload — bitmap blob + per-cue palette bytes +
/// geometry + PGS `composition_state` byte.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct PgsData {
/// Field 1: `bitmap`
#[cfg_attr(
feature = "json",
serde(
rename = "bitmap",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub bitmap: ::buffa::bytes::Bytes,
/// Field 2: `width`
#[cfg_attr(
feature = "json",
serde(
rename = "width",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub width: u32,
/// Field 3: `height`
#[cfg_attr(
feature = "json",
serde(
rename = "height",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub height: u32,
/// Field 4: `pos_x`
#[cfg_attr(
feature = "json",
serde(
rename = "posX",
alias = "pos_x",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub pos_x: i32,
/// Field 5: `pos_y`
#[cfg_attr(
feature = "json",
serde(
rename = "posY",
alias = "pos_y",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub pos_y: i32,
/// Field 6: `palette_bytes`
#[cfg_attr(
feature = "json",
serde(
rename = "paletteBytes",
alias = "palette_bytes",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub palette_bytes: ::buffa::bytes::Bytes,
/// Field 7: `composition_state`
#[cfg_attr(
feature = "json",
serde(
rename = "compositionState",
alias = "composition_state",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub composition_state: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for PgsData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("PgsData")
.field("bitmap", &self.bitmap)
.field("width", &self.width)
.field("height", &self.height)
.field("pos_x", &self.pos_x)
.field("pos_y", &self.pos_y)
.field("palette_bytes", &self.palette_bytes)
.field("composition_state", &self.composition_state)
.finish()
}
}
impl PgsData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.PgsData";
}
impl ::buffa::DefaultInstance for PgsData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<PgsData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for PgsData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "PgsData";
const FULL_NAME: &'static str = "media.v1.PgsData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.PgsData";
}
impl ::buffa::Message for PgsData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.bitmap.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.bitmap) as u32;
}
if self.width != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.width) as u32;
}
if self.height != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.height) as u32;
}
if self.pos_x != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.pos_x) as u32;
}
if self.pos_y != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.pos_y) as u32;
}
if !self.palette_bytes.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.palette_bytes) as u32;
}
if self.composition_state != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.composition_state) 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.bitmap.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.bitmap, buf);
}
if self.width != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.width, buf);
}
if self.height != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.height, buf);
}
if self.pos_x != 0i32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.pos_x, buf);
}
if self.pos_y != 0i32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.pos_y, buf);
}
if !self.palette_bytes.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.palette_bytes, buf);
}
if self.composition_state != 0u32 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.composition_state, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.bitmap = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.width = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.height = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.pos_x = ::buffa::types::decode_int32(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.pos_y = ::buffa::types::decode_int32(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.palette_bytes = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.composition_state = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.bitmap = ::buffa::bytes::Bytes::new();
self.width = 0u32;
self.height = 0u32;
self.pos_x = 0i32;
self.pos_y = 0i32;
self.palette_bytes = ::buffa::bytes::Bytes::new();
self.composition_state = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for PgsData {
const PROTO_FQN: &'static str = "media.v1.PgsData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for PgsData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __PGS_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.PgsData",
to_json: ::buffa::type_registry::any_to_json::<PgsData>,
from_json: ::buffa::type_registry::any_from_json::<PgsData>,
is_wkt: false,
};
/// CEA-608 per-cue payload. `channel` is validated 1..=4 at the bridge.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Cea608Data {
/// Field 1: `channel`
#[cfg_attr(
feature = "json",
serde(
rename = "channel",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub channel: u32,
/// Field 2: `pac_byte_pair`
#[cfg_attr(
feature = "json",
serde(
rename = "pacBytePair",
alias = "pac_byte_pair",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub pac_byte_pair: u32,
/// Field 3: `styled_text`
#[cfg_attr(
feature = "json",
serde(
rename = "styledText",
alias = "styled_text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub styled_text: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Cea608Data {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Cea608Data")
.field("channel", &self.channel)
.field("pac_byte_pair", &self.pac_byte_pair)
.field("styled_text", &self.styled_text)
.finish()
}
}
impl Cea608Data {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Cea608Data";
}
impl ::buffa::DefaultInstance for Cea608Data {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Cea608Data> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Cea608Data {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Cea608Data";
const FULL_NAME: &'static str = "media.v1.Cea608Data";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Cea608Data";
}
impl ::buffa::Message for Cea608Data {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.channel != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.channel) as u32;
}
if self.pac_byte_pair != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.pac_byte_pair) as u32;
}
if !self.styled_text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.styled_text) 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.channel != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.channel, buf);
}
if self.pac_byte_pair != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.pac_byte_pair, buf);
}
if !self.styled_text.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.styled_text, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.channel = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.pac_byte_pair = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.styled_text = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.channel = 0u32;
self.pac_byte_pair = 0u32;
self.styled_text = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Cea608Data {
const PROTO_FQN: &'static str = "media.v1.Cea608Data";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Cea608Data {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __CEA608DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Cea608Data",
to_json: ::buffa::type_registry::any_to_json::<Cea608Data>,
from_json: ::buffa::type_registry::any_from_json::<Cea608Data>,
is_wkt: false,
};
/// EBU STL per-cue payload. `justification` is validated 1..=3 at the
/// bridge.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct EbuStlData {
/// Field 1: `subtitle_number`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleNumber",
alias = "subtitle_number",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub subtitle_number: u32,
/// Field 2: `cumulative`
#[cfg_attr(
feature = "json",
serde(
rename = "cumulative",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub cumulative: bool,
/// Field 3: `vertical_pos`
#[cfg_attr(
feature = "json",
serde(
rename = "verticalPos",
alias = "vertical_pos",
with = "::buffa::json_helpers::int32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i32"
)
)]
pub vertical_pos: i32,
/// Field 4: `justification`
#[cfg_attr(
feature = "json",
serde(
rename = "justification",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub justification: u32,
/// Field 5: `styled_text`
#[cfg_attr(
feature = "json",
serde(
rename = "styledText",
alias = "styled_text",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub styled_text: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for EbuStlData {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("EbuStlData")
.field("subtitle_number", &self.subtitle_number)
.field("cumulative", &self.cumulative)
.field("vertical_pos", &self.vertical_pos)
.field("justification", &self.justification)
.field("styled_text", &self.styled_text)
.finish()
}
}
impl EbuStlData {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.EbuStlData";
}
impl ::buffa::DefaultInstance for EbuStlData {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<EbuStlData> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for EbuStlData {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "EbuStlData";
const FULL_NAME: &'static str = "media.v1.EbuStlData";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.EbuStlData";
}
impl ::buffa::Message for EbuStlData {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.subtitle_number != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.subtitle_number) as u32;
}
if self.cumulative {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.vertical_pos != 0i32 {
size += 1u32 + ::buffa::types::int32_encoded_len(self.vertical_pos) as u32;
}
if self.justification != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.justification) as u32;
}
if !self.styled_text.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.styled_text) 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.subtitle_number != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.subtitle_number, buf);
}
if self.cumulative {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.cumulative, buf);
}
if self.vertical_pos != 0i32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(self.vertical_pos, buf);
}
if self.justification != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.justification, buf);
}
if !self.styled_text.is_empty() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.styled_text, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_number = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.cumulative = ::buffa::types::decode_bool(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.vertical_pos = ::buffa::types::decode_int32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.justification = ::buffa::types::decode_uint32(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.styled_text = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subtitle_number = 0u32;
self.cumulative = false;
self.vertical_pos = 0i32;
self.justification = 0u32;
self.styled_text = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for EbuStlData {
const PROTO_FQN: &'static str = "media.v1.EbuStlData";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for EbuStlData {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __EBU_STL_DATA_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.EbuStlData",
to_json: ::buffa::type_registry::any_to_json::<EbuStlData>,
from_json: ::buffa::type_registry::any_from_json::<EbuStlData>,
is_wkt: false,
};
/// Per-track DVD VobSub palette — 16-entry RGB lookup table (each entry
/// is `0x00RRGGBB`). Cues' per-cue `color_indices` / `contrast_indices`
/// reference these.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VobSubPalette {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `subtitle_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "subtitleTrackId",
alias = "subtitle_track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub subtitle_track_id: ::buffa::bytes::Bytes,
/// Field 3: `entries`
#[cfg_attr(
feature = "json",
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<u32>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VobSubPalette {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VobSubPalette")
.field("id", &self.id)
.field("subtitle_track_id", &self.subtitle_track_id)
.field("entries", &self.entries)
.finish()
}
}
impl VobSubPalette {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VobSubPalette";
}
impl ::buffa::DefaultInstance for VobSubPalette {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VobSubPalette> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VobSubPalette {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VobSubPalette";
const FULL_NAME: &'static str = "media.v1.VobSubPalette";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VobSubPalette";
}
impl ::buffa::Message for VobSubPalette {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.subtitle_track_id.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.subtitle_track_id) as u32;
}
if !self.entries.is_empty() {
let payload: u32 = self
.entries
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u32)
.sum::<u32>();
size
+= 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32 + payload;
}
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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.subtitle_track_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.subtitle_track_id, buf);
}
if !self.entries.is_empty() {
let payload: u32 = self
.entries
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u32)
.sum::<u32>();
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(payload as u64, buf);
for &v in &self.entries {
::buffa::types::encode_uint32(v, buf);
}
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.subtitle_track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
self.entries.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.entries.push(::buffa::types::decode_uint32(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.entries.push(::buffa::types::decode_uint32(buf)?);
} else {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.subtitle_track_id = ::buffa::bytes::Bytes::new();
self.entries.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VobSubPalette {
const PROTO_FQN: &'static str = "media.v1.VobSubPalette";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VobSubPalette {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VOB_SUB_PALETTE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VobSubPalette",
to_json: ::buffa::type_registry::any_to_json::<VobSubPalette>,
from_json: ::buffa::type_registry::any_from_json::<VobSubPalette>,
is_wkt: false,
};
/// ── Batch 6: Scene + VLM (§6.5 non-audio table; §6.8 #2 for SceneVlmResult) ──
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Scene {
/// Field 1: `meta`
#[cfg_attr(
feature = "json",
serde(
rename = "meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub meta: ::buffa::MessageField<SceneMeta>,
/// Field 2: `keyframes`
#[cfg_attr(
feature = "json",
serde(
rename = "keyframes",
with = "::buffa::json_helpers::proto_seq",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_vec)
)]
pub keyframes: ::buffa::alloc::vec::Vec<::buffa::bytes::Bytes>,
/// Field 3: `description`
#[cfg_attr(
feature = "json",
serde(
rename = "description",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub description: ::buffa::smol_str::SmolStr,
/// Field 4: `shot_type`
#[cfg_attr(
feature = "json",
serde(
rename = "shotType",
alias = "shot_type",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub shot_type: ::buffa::smol_str::SmolStr,
/// Field 5: `camera_motion`
#[cfg_attr(
feature = "json",
serde(
rename = "cameraMotion",
alias = "camera_motion",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub camera_motion: ::buffa::smol_str::SmolStr,
/// Field 6: `tags`
#[cfg_attr(
feature = "json",
serde(
rename = "tags",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub tags: ::buffa::smol_str::SmolStr,
/// Field 7: `people_count`
#[cfg_attr(
feature = "json",
serde(
rename = "peopleCount",
alias = "people_count",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub people_count: u32,
/// Field 8: `tag_ids`
#[cfg_attr(
feature = "json",
serde(
rename = "tagIds",
alias = "tag_ids",
with = "::buffa::json_helpers::proto_seq",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_vec)
)]
pub tag_ids: ::buffa::alloc::vec::Vec<::buffa::bytes::Bytes>,
/// Field 9: `vision_provider`
#[cfg_attr(
feature = "json",
serde(
rename = "visionProvider",
alias = "vision_provider",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub vision_provider: ::buffa::alloc::vec::Vec<::buffa::smol_str::SmolStr>,
/// Field 10: `smart_folders`
#[cfg_attr(
feature = "json",
serde(
rename = "smartFolders",
alias = "smart_folders",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub smart_folders: ::buffa::alloc::vec::Vec<::buffa::smol_str::SmolStr>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Scene {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Scene")
.field("meta", &self.meta)
.field("keyframes", &self.keyframes)
.field("description", &self.description)
.field("shot_type", &self.shot_type)
.field("camera_motion", &self.camera_motion)
.field("tags", &self.tags)
.field("people_count", &self.people_count)
.field("tag_ids", &self.tag_ids)
.field("vision_provider", &self.vision_provider)
.field("smart_folders", &self.smart_folders)
.finish()
}
}
impl Scene {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Scene";
}
impl ::buffa::DefaultInstance for Scene {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Scene> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Scene {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Scene";
const FULL_NAME: &'static str = "media.v1.Scene";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Scene";
}
impl ::buffa::Message for Scene {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.keyframes {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
if !self.description.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.description) as u32;
}
if !self.shot_type.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.shot_type) as u32;
}
if !self.camera_motion.is_empty() {
size
+= 1u32 + ::buffa::types::string_encoded_len(&self.camera_motion) as u32;
}
if !self.tags.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.tags) as u32;
}
if self.people_count != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.people_count) as u32;
}
for v in &self.tag_ids {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
for v in &self.vision_provider {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
for v in &self.smart_folders {
size += 1u32 + ::buffa::types::string_encoded_len(v) 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.meta.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.meta.write_to(__cache, buf);
}
for v in &self.keyframes {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
if !self.description.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.description, buf);
}
if !self.shot_type.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.shot_type, buf);
}
if !self.camera_motion.is_empty() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.camera_motion, buf);
}
if !self.tags.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.tags, buf);
}
if self.people_count != 0u32 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.people_count, buf);
}
for v in &self.tag_ids {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
for v in &self.vision_provider {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
for v in &self.smart_folders {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.meta.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.keyframes.push(::buffa::types::decode_bytes_to_bytes(buf)?);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.description = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.shot_type = ::buffa::types::decode_string_to(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.camera_motion = ::buffa::types::decode_string_to(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.tags = ::buffa::types::decode_string_to(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.people_count = ::buffa::types::decode_uint32(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.tag_ids.push(::buffa::types::decode_bytes_to_bytes(buf)?);
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.vision_provider.push(::buffa::types::decode_string_to(buf)?);
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.smart_folders.push(::buffa::types::decode_string_to(buf)?);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.meta = ::buffa::MessageField::none();
self.keyframes.clear();
self.description = ::core::default::Default::default();
self.shot_type = ::core::default::Default::default();
self.camera_motion = ::core::default::Default::default();
self.tags = ::core::default::Default::default();
self.people_count = 0u32;
self.tag_ids.clear();
self.vision_provider.clear();
self.smart_folders.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Scene {
const PROTO_FQN: &'static str = "media.v1.Scene";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Scene {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SCENE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Scene",
to_json: ::buffa::type_registry::any_to_json::<Scene>,
from_json: ::buffa::type_registry::any_from_json::<Scene>,
is_wkt: false,
};
/// Pure-Rust struct (scene_vlm.rs, no hand-rolled Encode); field tags
/// 1..11 assigned in struct-declaration order — a clean-redesign choice
/// (§2 grants this; no wire-compat to honor). §6.8 #2.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SceneVlmResult {
/// Field 1: `scene`
#[cfg_attr(
feature = "json",
serde(rename = "scene", skip_serializing_if = "::core::option::Option::is_none")
)]
pub scene: ::core::option::Option<::buffa::smol_str::SmolStr>,
/// Field 2: `description`
#[cfg_attr(
feature = "json",
serde(
rename = "description",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub description: ::core::option::Option<::buffa::smol_str::SmolStr>,
/// Field 3: `subjects`
#[cfg_attr(
feature = "json",
serde(
rename = "subjects",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub subjects: ::buffa::alloc::vec::Vec<SubjectDetection>,
/// Field 4: `objects`
#[cfg_attr(
feature = "json",
serde(
rename = "objects",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub objects: ::buffa::alloc::vec::Vec<ObjectDetection>,
/// Field 5: `actions`
#[cfg_attr(
feature = "json",
serde(
rename = "actions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub actions: ::buffa::alloc::vec::Vec<ActionDetection>,
/// Field 6: `mood`
#[cfg_attr(
feature = "json",
serde(
rename = "mood",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub mood: ::buffa::alloc::vec::Vec<MoodDetection>,
/// Field 7: `shot_type`
#[cfg_attr(
feature = "json",
serde(
rename = "shotType",
alias = "shot_type",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub shot_type: ::core::option::Option<::buffa::smol_str::SmolStr>,
/// Field 8: `lighting`
#[cfg_attr(
feature = "json",
serde(
rename = "lighting",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub lighting: ::buffa::alloc::vec::Vec<LightingDetection>,
/// Field 9: `colors`
#[cfg_attr(
feature = "json",
serde(
rename = "colors",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub colors: ::buffa::alloc::vec::Vec<ColorDetection>,
/// Field 10: `tags`
#[cfg_attr(
feature = "json",
serde(
rename = "tags",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub tags: ::buffa::alloc::vec::Vec<::buffa::smol_str::SmolStr>,
/// Field 11: `classifications`
#[cfg_attr(
feature = "json",
serde(
rename = "classifications",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub classifications: ::buffa::alloc::vec::Vec<ClassificationDetection>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SceneVlmResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SceneVlmResult")
.field("scene", &self.scene)
.field("description", &self.description)
.field("subjects", &self.subjects)
.field("objects", &self.objects)
.field("actions", &self.actions)
.field("mood", &self.mood)
.field("shot_type", &self.shot_type)
.field("lighting", &self.lighting)
.field("colors", &self.colors)
.field("tags", &self.tags)
.field("classifications", &self.classifications)
.finish()
}
}
impl SceneVlmResult {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SceneVlmResult";
}
impl SceneVlmResult {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::scene`] to `Some(value)`, consuming and returning `self`.
pub fn with_scene(mut self, value: impl Into<::buffa::smol_str::SmolStr>) -> Self {
self.scene = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::description`] to `Some(value)`, consuming and returning `self`.
pub fn with_description(
mut self,
value: impl Into<::buffa::smol_str::SmolStr>,
) -> Self {
self.description = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::shot_type`] to `Some(value)`, consuming and returning `self`.
pub fn with_shot_type(
mut self,
value: impl Into<::buffa::smol_str::SmolStr>,
) -> Self {
self.shot_type = Some(value.into());
self
}
}
impl ::buffa::DefaultInstance for SceneVlmResult {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SceneVlmResult> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SceneVlmResult {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SceneVlmResult";
const FULL_NAME: &'static str = "media.v1.SceneVlmResult";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SceneVlmResult";
}
impl ::buffa::Message for SceneVlmResult {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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 Some(ref v) = self.scene {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.description {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
for v in &self.subjects {
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;
}
for v in &self.objects {
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;
}
for v in &self.actions {
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;
}
for v in &self.mood {
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;
}
if let Some(ref v) = self.shot_type {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
for v in &self.lighting {
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;
}
for v in &self.colors {
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;
}
for v in &self.tags {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
for v in &self.classifications {
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 _;
if let Some(ref v) = self.scene {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.description {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
for v in &self.subjects {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.objects {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.actions {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.mood {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if let Some(ref v) = self.shot_type {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
for v in &self.lighting {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.colors {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.tags {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
for v in &self.classifications {
::buffa::encoding::Tag::new(
11u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.scene = ::core::option::Option::Some(
::buffa::types::decode_string_to(buf)?,
);
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.description = ::core::option::Option::Some(
::buffa::types::decode_string_to(buf)?,
);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.subjects.push(elem);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.objects.push(elem);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.actions.push(elem);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.mood.push(elem);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.shot_type = ::core::option::Option::Some(
::buffa::types::decode_string_to(buf)?,
);
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.lighting.push(elem);
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.colors.push(elem);
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.tags.push(::buffa::types::decode_string_to(buf)?);
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.classifications.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.scene = ::core::option::Option::None;
self.description = ::core::option::Option::None;
self.subjects.clear();
self.objects.clear();
self.actions.clear();
self.mood.clear();
self.shot_type = ::core::option::Option::None;
self.lighting.clear();
self.colors.clear();
self.tags.clear();
self.classifications.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SceneVlmResult {
const PROTO_FQN: &'static str = "media.v1.SceneVlmResult";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SceneVlmResult {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SCENE_VLM_RESULT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SceneVlmResult",
to_json: ::buffa::type_registry::any_to_json::<SceneVlmResult>,
from_json: ::buffa::type_registry::any_from_json::<SceneVlmResult>,
is_wkt: false,
};
/// ── Batch 7: Keyframe (§6.5 non-audio table) ────────────────────────────────
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Keyframe {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `scene_id`
#[cfg_attr(
feature = "json",
serde(
rename = "sceneId",
alias = "scene_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub scene_id: ::buffa::bytes::Bytes,
/// Field 3: `pts`
#[cfg_attr(
feature = "json",
serde(
rename = "pts",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub pts: i64,
/// Field 4: `dimensions`
#[cfg_attr(
feature = "json",
serde(
rename = "dimensions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub dimensions: ::buffa::MessageField<Dimensions>,
/// Field 5: `data`
#[cfg_attr(
feature = "json",
serde(
rename = "data",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub data: ::buffa::bytes::Bytes,
/// Field 6: `classifications`
#[cfg_attr(
feature = "json",
serde(
rename = "classifications",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub classifications: ::buffa::alloc::vec::Vec<ClassificationDetection>,
/// Field 7: `humans`
#[cfg_attr(
feature = "json",
serde(
rename = "humans",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub humans: ::buffa::MessageField<HumanAnalysis>,
/// Field 8: `animals`
#[cfg_attr(
feature = "json",
serde(
rename = "animals",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub animals: ::buffa::MessageField<AnimalAnalysis>,
/// Field 9: `objects`
#[cfg_attr(
feature = "json",
serde(
rename = "objects",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub objects: ::buffa::alloc::vec::Vec<ObjectDetection>,
/// Field 10: `actions`
#[cfg_attr(
feature = "json",
serde(
rename = "actions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub actions: ::buffa::alloc::vec::Vec<ActionDetection>,
/// Field 11: `mood`
#[cfg_attr(
feature = "json",
serde(
rename = "mood",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub mood: ::buffa::alloc::vec::Vec<MoodDetection>,
/// Field 12: `emotion`
#[cfg_attr(
feature = "json",
serde(
rename = "emotion",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub emotion: ::buffa::alloc::vec::Vec<EmotionDetection>,
/// Field 13: `lighting`
#[cfg_attr(
feature = "json",
serde(
rename = "lighting",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub lighting: ::buffa::alloc::vec::Vec<LightingDetection>,
/// Field 14: `colors`
#[cfg_attr(
feature = "json",
serde(
rename = "colors",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub colors: ::buffa::alloc::vec::Vec<ColorDetection>,
/// Field 15: `text_detections`
#[cfg_attr(
feature = "json",
serde(
rename = "textDetections",
alias = "text_detections",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub text_detections: ::buffa::alloc::vec::Vec<TextDetection>,
/// Field 16: `barcodes`
#[cfg_attr(
feature = "json",
serde(
rename = "barcodes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub barcodes: ::buffa::alloc::vec::Vec<BarcodeDetection>,
/// Field 17: `attention_saliency`
#[cfg_attr(
feature = "json",
serde(
rename = "attentionSaliency",
alias = "attention_saliency",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub attention_saliency: ::buffa::alloc::vec::Vec<SaliencyRegion>,
/// Field 18: `objectness_saliency`
#[cfg_attr(
feature = "json",
serde(
rename = "objectnessSaliency",
alias = "objectness_saliency",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub objectness_saliency: ::buffa::alloc::vec::Vec<SaliencyRegion>,
/// Field 19: `horizon`
#[cfg_attr(
feature = "json",
serde(
rename = "horizon",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub horizon: ::buffa::MessageField<HorizonInfo>,
/// Field 20: `document_segments`
#[cfg_attr(
feature = "json",
serde(
rename = "documentSegments",
alias = "document_segments",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub document_segments: ::buffa::alloc::vec::Vec<DocumentSegment>,
/// Field 21: `feature_print`
#[cfg_attr(
feature = "json",
serde(
rename = "featurePrint",
alias = "feature_print",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub feature_print: ::buffa::MessageField<FeaturePrint>,
/// Field 22: `aesthetics`
#[cfg_attr(
feature = "json",
serde(
rename = "aesthetics",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub aesthetics: ::buffa::MessageField<Aesthetics>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Keyframe {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Keyframe")
.field("id", &self.id)
.field("scene_id", &self.scene_id)
.field("pts", &self.pts)
.field("dimensions", &self.dimensions)
.field("data", &self.data)
.field("classifications", &self.classifications)
.field("humans", &self.humans)
.field("animals", &self.animals)
.field("objects", &self.objects)
.field("actions", &self.actions)
.field("mood", &self.mood)
.field("emotion", &self.emotion)
.field("lighting", &self.lighting)
.field("colors", &self.colors)
.field("text_detections", &self.text_detections)
.field("barcodes", &self.barcodes)
.field("attention_saliency", &self.attention_saliency)
.field("objectness_saliency", &self.objectness_saliency)
.field("horizon", &self.horizon)
.field("document_segments", &self.document_segments)
.field("feature_print", &self.feature_print)
.field("aesthetics", &self.aesthetics)
.finish()
}
}
impl Keyframe {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Keyframe";
}
impl ::buffa::DefaultInstance for Keyframe {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Keyframe> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Keyframe {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Keyframe";
const FULL_NAME: &'static str = "media.v1.Keyframe";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Keyframe";
}
impl ::buffa::Message for Keyframe {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.scene_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.scene_id) as u32;
}
if self.pts != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.pts) as u32;
}
if self.dimensions.is_set() {
let __slot = __cache.reserve();
let inner_size = self.dimensions.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.data.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.data) as u32;
}
for v in &self.classifications {
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;
}
if self.humans.is_set() {
let __slot = __cache.reserve();
let inner_size = self.humans.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.animals.is_set() {
let __slot = __cache.reserve();
let inner_size = self.animals.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.objects {
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;
}
for v in &self.actions {
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;
}
for v in &self.mood {
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;
}
for v in &self.emotion {
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;
}
for v in &self.lighting {
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;
}
for v in &self.colors {
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;
}
for v in &self.text_detections {
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;
}
for v in &self.barcodes {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.attention_saliency {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.objectness_saliency {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.horizon.is_set() {
let __slot = __cache.reserve();
let inner_size = self.horizon.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.document_segments {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.feature_print.is_set() {
let __slot = __cache.reserve();
let inner_size = self.feature_print.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.aesthetics.is_set() {
let __slot = __cache.reserve();
let inner_size = self.aesthetics.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.scene_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.scene_id, buf);
}
if self.pts != 0i64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.pts, buf);
}
if self.dimensions.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.dimensions.write_to(__cache, buf);
}
if !self.data.is_empty() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.data, buf);
}
for v in &self.classifications {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.humans.is_set() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.humans.write_to(__cache, buf);
}
if self.animals.is_set() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.animals.write_to(__cache, buf);
}
for v in &self.objects {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.actions {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.mood {
::buffa::encoding::Tag::new(
11u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.emotion {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.lighting {
::buffa::encoding::Tag::new(
13u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.colors {
::buffa::encoding::Tag::new(
14u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.text_detections {
::buffa::encoding::Tag::new(
15u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.barcodes {
::buffa::encoding::Tag::new(
16u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.attention_saliency {
::buffa::encoding::Tag::new(
17u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
for v in &self.objectness_saliency {
::buffa::encoding::Tag::new(
18u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.horizon.is_set() {
::buffa::encoding::Tag::new(
19u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.horizon.write_to(__cache, buf);
}
for v in &self.document_segments {
::buffa::encoding::Tag::new(
20u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.feature_print.is_set() {
::buffa::encoding::Tag::new(
21u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.feature_print.write_to(__cache, buf);
}
if self.aesthetics.is_set() {
::buffa::encoding::Tag::new(
22u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.aesthetics.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.scene_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.pts = ::buffa::types::decode_int64(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.dimensions.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.data = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.classifications.push(elem);
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.humans.get_or_insert_default(),
buf,
depth,
)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.animals.get_or_insert_default(),
buf,
depth,
)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.objects.push(elem);
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.actions.push(elem);
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.mood.push(elem);
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.emotion.push(elem);
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.lighting.push(elem);
}
14u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 14u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.colors.push(elem);
}
15u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.text_detections.push(elem);
}
16u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 16u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.barcodes.push(elem);
}
17u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 17u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.attention_saliency.push(elem);
}
18u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 18u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.objectness_saliency.push(elem);
}
19u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 19u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.horizon.get_or_insert_default(),
buf,
depth,
)?;
}
20u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.document_segments.push(elem);
}
21u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 21u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.feature_print.get_or_insert_default(),
buf,
depth,
)?;
}
22u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 22u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.aesthetics.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.scene_id = ::buffa::bytes::Bytes::new();
self.pts = 0i64;
self.dimensions = ::buffa::MessageField::none();
self.data = ::buffa::bytes::Bytes::new();
self.classifications.clear();
self.humans = ::buffa::MessageField::none();
self.animals = ::buffa::MessageField::none();
self.objects.clear();
self.actions.clear();
self.mood.clear();
self.emotion.clear();
self.lighting.clear();
self.colors.clear();
self.text_detections.clear();
self.barcodes.clear();
self.attention_saliency.clear();
self.objectness_saliency.clear();
self.horizon = ::buffa::MessageField::none();
self.document_segments.clear();
self.feature_print = ::buffa::MessageField::none();
self.aesthetics = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Keyframe {
const PROTO_FQN: &'static str = "media.v1.Keyframe";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Keyframe {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __KEYFRAME_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Keyframe",
to_json: ::buffa::type_registry::any_to_json::<Keyframe>,
from_json: ::buffa::type_registry::any_from_json::<Keyframe>,
is_wkt: false,
};
/// ── Batch 8: audio meta + summary blocks (§6.5 audio aggregates table) ──────
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioMeta {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 3: `container`
#[cfg_attr(
feature = "json",
serde(
rename = "container",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub container: ::buffa::smol_str::SmolStr,
/// Field 4: `size`
#[cfg_attr(
feature = "json",
serde(
rename = "size",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub size: u64,
/// Field 5: `time`
#[cfg_attr(
feature = "json",
serde(
rename = "time",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub time: ::buffa::MessageField<TrackTime>,
/// Field 6: `created_at`
#[cfg_attr(
feature = "json",
serde(
rename = "createdAt",
alias = "created_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub created_at: i64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioMeta")
.field("id", &self.id)
.field("name", &self.name)
.field("container", &self.container)
.field("size", &self.size)
.field("time", &self.time)
.field("created_at", &self.created_at)
.finish()
}
}
impl AudioMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioMeta";
}
impl ::buffa::DefaultInstance for AudioMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioMeta";
const FULL_NAME: &'static str = "media.v1.AudioMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioMeta";
}
impl ::buffa::Message for AudioMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.container.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.container) as u32;
}
if self.size != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.size) as u32;
}
if self.time.is_set() {
let __slot = __cache.reserve();
let inner_size = self.time.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.created_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.created_at) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if !self.container.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.container, buf);
}
if self.size != 0u64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.size, buf);
}
if self.time.is_set() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.time.write_to(__cache, buf);
}
if self.created_at != 0i64 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.created_at, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.container = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.size = ::buffa::types::decode_uint64(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.time.get_or_insert_default(),
buf,
depth,
)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.created_at = ::buffa::types::decode_int64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.name = ::core::default::Default::default();
self.container = ::core::default::Default::default();
self.size = 0u64;
self.time = ::buffa::MessageField::none();
self.created_at = 0i64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioMeta {
const PROTO_FQN: &'static str = "media.v1.AudioMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioMeta",
to_json: ::buffa::type_registry::any_to_json::<AudioMeta>,
from_json: ::buffa::type_registry::any_from_json::<AudioMeta>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioStreamMeta {
/// Field 1: `codec_id`
#[cfg_attr(
feature = "json",
serde(
rename = "codecId",
alias = "codec_id",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub codec_id: ::buffa::MessageField<CodecId>,
/// Field 2: `sample_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "sampleRate",
alias = "sample_rate",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub sample_rate: u32,
/// Field 3: `layout`
#[cfg_attr(
feature = "json",
serde(
rename = "layout",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub layout: ::buffa::MessageField<AudioChannelLayout>,
/// Field 4: `bit_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "bitRate",
alias = "bit_rate",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub bit_rate: u64,
/// Field 5: `language`
#[cfg_attr(
feature = "json",
serde(
rename = "language",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub language: ::buffa::smol_str::SmolStr,
/// Field 6: `stream_title`
#[cfg_attr(
feature = "json",
serde(
rename = "streamTitle",
alias = "stream_title",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub stream_title: ::buffa::smol_str::SmolStr,
/// Field 7: `album`
#[cfg_attr(
feature = "json",
serde(
rename = "album",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub album: ::buffa::smol_str::SmolStr,
/// Field 8: `artist`
#[cfg_attr(
feature = "json",
serde(
rename = "artist",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub artist: ::buffa::smol_str::SmolStr,
/// Field 9: `title`
#[cfg_attr(
feature = "json",
serde(
rename = "title",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub title: ::buffa::smol_str::SmolStr,
/// Field 10: `genre`
#[cfg_attr(
feature = "json",
serde(
rename = "genre",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub genre: ::buffa::smol_str::SmolStr,
/// Field 11: `track_number`
#[cfg_attr(
feature = "json",
serde(
rename = "trackNumber",
alias = "track_number",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub track_number: u32,
/// Field 12: `sample_format`
#[cfg_attr(
feature = "json",
serde(
rename = "sampleFormat",
alias = "sample_format",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub sample_format: ::buffa::smol_str::SmolStr,
/// Field 13: `bits_per_sample`
#[cfg_attr(
feature = "json",
serde(
rename = "bitsPerSample",
alias = "bits_per_sample",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub bits_per_sample: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioStreamMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioStreamMeta")
.field("codec_id", &self.codec_id)
.field("sample_rate", &self.sample_rate)
.field("layout", &self.layout)
.field("bit_rate", &self.bit_rate)
.field("language", &self.language)
.field("stream_title", &self.stream_title)
.field("album", &self.album)
.field("artist", &self.artist)
.field("title", &self.title)
.field("genre", &self.genre)
.field("track_number", &self.track_number)
.field("sample_format", &self.sample_format)
.field("bits_per_sample", &self.bits_per_sample)
.finish()
}
}
impl AudioStreamMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioStreamMeta";
}
impl ::buffa::DefaultInstance for AudioStreamMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioStreamMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioStreamMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioStreamMeta";
const FULL_NAME: &'static str = "media.v1.AudioStreamMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioStreamMeta";
}
impl ::buffa::Message for AudioStreamMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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_id.is_set() {
let __slot = __cache.reserve();
let inner_size = self.codec_id.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.sample_rate != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.sample_rate) as u32;
}
if self.layout.is_set() {
let __slot = __cache.reserve();
let inner_size = self.layout.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.bit_rate != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.bit_rate) as u32;
}
if !self.language.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.language) as u32;
}
if !self.stream_title.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.stream_title) as u32;
}
if !self.album.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.album) as u32;
}
if !self.artist.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.artist) as u32;
}
if !self.title.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.title) as u32;
}
if !self.genre.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.genre) as u32;
}
if self.track_number != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.track_number) as u32;
}
if !self.sample_format.is_empty() {
size
+= 1u32 + ::buffa::types::string_encoded_len(&self.sample_format) as u32;
}
if self.bits_per_sample != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.bits_per_sample) 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_id.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.codec_id.write_to(__cache, buf);
}
if self.sample_rate != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.sample_rate, buf);
}
if self.layout.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.layout.write_to(__cache, buf);
}
if self.bit_rate != 0u64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.bit_rate, buf);
}
if !self.language.is_empty() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.language, buf);
}
if !self.stream_title.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.stream_title, buf);
}
if !self.album.is_empty() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.album, buf);
}
if !self.artist.is_empty() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.artist, buf);
}
if !self.title.is_empty() {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.title, buf);
}
if !self.genre.is_empty() {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.genre, buf);
}
if self.track_number != 0u32 {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.track_number, buf);
}
if !self.sample_format.is_empty() {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.sample_format, buf);
}
if self.bits_per_sample != 0u32 {
::buffa::encoding::Tag::new(13u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.bits_per_sample, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.codec_id.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.sample_rate = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.layout.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.bit_rate = ::buffa::types::decode_uint64(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.language = ::buffa::types::decode_string_to(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.stream_title = ::buffa::types::decode_string_to(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.album = ::buffa::types::decode_string_to(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.artist = ::buffa::types::decode_string_to(buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.title = ::buffa::types::decode_string_to(buf)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.genre = ::buffa::types::decode_string_to(buf)?;
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.track_number = ::buffa::types::decode_uint32(buf)?;
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.sample_format = ::buffa::types::decode_string_to(buf)?;
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.bits_per_sample = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.codec_id = ::buffa::MessageField::none();
self.sample_rate = 0u32;
self.layout = ::buffa::MessageField::none();
self.bit_rate = 0u64;
self.language = ::core::default::Default::default();
self.stream_title = ::core::default::Default::default();
self.album = ::core::default::Default::default();
self.artist = ::core::default::Default::default();
self.title = ::core::default::Default::default();
self.genre = ::core::default::Default::default();
self.track_number = 0u32;
self.sample_format = ::core::default::Default::default();
self.bits_per_sample = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioStreamMeta {
const PROTO_FQN: &'static str = "media.v1.AudioStreamMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioStreamMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_STREAM_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioStreamMeta",
to_json: ::buffa::type_registry::any_to_json::<AudioStreamMeta>,
from_json: ::buffa::type_registry::any_from_json::<AudioStreamMeta>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioTrackMeta {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `ordinal`
#[cfg_attr(
feature = "json",
serde(
rename = "ordinal",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub ordinal: u32,
/// Field 3: `stream_index`
#[cfg_attr(
feature = "json",
serde(
rename = "streamIndex",
alias = "stream_index",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub stream_index: u32,
/// Field 4: `container_track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "containerTrackId",
alias = "container_track_id",
with = "::buffa::json_helpers::opt_uint64",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub container_track_id: ::core::option::Option<u64>,
/// Field 5: `time`
#[cfg_attr(
feature = "json",
serde(
rename = "time",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub time: ::buffa::MessageField<TrackTime>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioTrackMeta {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioTrackMeta")
.field("id", &self.id)
.field("ordinal", &self.ordinal)
.field("stream_index", &self.stream_index)
.field("container_track_id", &self.container_track_id)
.field("time", &self.time)
.finish()
}
}
impl AudioTrackMeta {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioTrackMeta";
}
impl AudioTrackMeta {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::container_track_id`] to `Some(value)`, consuming and returning `self`.
pub fn with_container_track_id(mut self, value: u64) -> Self {
self.container_track_id = Some(value);
self
}
}
impl ::buffa::DefaultInstance for AudioTrackMeta {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioTrackMeta> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioTrackMeta {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioTrackMeta";
const FULL_NAME: &'static str = "media.v1.AudioTrackMeta";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioTrackMeta";
}
impl ::buffa::Message for AudioTrackMeta {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if self.ordinal != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.ordinal) as u32;
}
if self.stream_index != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.stream_index) as u32;
}
if let Some(v) = self.container_track_id {
size += 1u32 + ::buffa::types::uint64_encoded_len(v) as u32;
}
if self.time.is_set() {
let __slot = __cache.reserve();
let inner_size = self.time.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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if self.ordinal != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.ordinal, buf);
}
if self.stream_index != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.stream_index, buf);
}
if let Some(v) = self.container_track_id {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(v, buf);
}
if self.time.is_set() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.time.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.ordinal = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.stream_index = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.container_track_id = ::core::option::Option::Some(
::buffa::types::decode_uint64(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.time.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.ordinal = 0u32;
self.stream_index = 0u32;
self.container_track_id = ::core::option::Option::None;
self.time = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioTrackMeta {
const PROTO_FQN: &'static str = "media.v1.AudioTrackMeta";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioTrackMeta {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_TRACK_META_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioTrackMeta",
to_json: ::buffa::type_registry::any_to_json::<AudioTrackMeta>,
from_json: ::buffa::type_registry::any_from_json::<AudioTrackMeta>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioSummary {
/// Field 1: `prefilter_class`
#[cfg_attr(
feature = "json",
serde(
rename = "prefilterClass",
alias = "prefilter_class",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub prefilter_class: ::buffa::EnumValue<AudioPrefilterClass>,
/// Field 2: `audio_type`
#[cfg_attr(
feature = "json",
serde(
rename = "audioType",
alias = "audio_type",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub audio_type: ::buffa::MessageField<TagConfidence>,
/// Field 3: `scene`
#[cfg_attr(
feature = "json",
serde(
rename = "scene",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub scene: ::buffa::MessageField<TagConfidence>,
/// Field 4: `mood`
#[cfg_attr(
feature = "json",
serde(
rename = "mood",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub mood: ::buffa::MessageField<TagConfidence>,
/// Field 5: `voice`
#[cfg_attr(
feature = "json",
serde(
rename = "voice",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub voice: ::buffa::MessageField<TagConfidence>,
/// Field 6: `has_speech`
#[cfg_attr(
feature = "json",
serde(
rename = "hasSpeech",
alias = "has_speech",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub has_speech: bool,
/// Field 7: `has_music`
#[cfg_attr(
feature = "json",
serde(
rename = "hasMusic",
alias = "has_music",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub has_music: bool,
/// Field 8: `dominant_language`
#[cfg_attr(
feature = "json",
serde(
rename = "dominantLanguage",
alias = "dominant_language",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub dominant_language: ::buffa::smol_str::SmolStr,
/// Field 9: `speech_ratio`
#[cfg_attr(
feature = "json",
serde(
rename = "speechRatio",
alias = "speech_ratio",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub speech_ratio: f32,
/// Field 10: `speaker_count`
#[cfg_attr(
feature = "json",
serde(
rename = "speakerCount",
alias = "speaker_count",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub speaker_count: u32,
/// Field 11: `loudness_lufs`
#[cfg_attr(
feature = "json",
serde(
rename = "loudnessLufs",
alias = "loudness_lufs",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub loudness_lufs: f32,
/// Field 12: `rms_db`
#[cfg_attr(
feature = "json",
serde(
rename = "rmsDb",
alias = "rms_db",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub rms_db: f32,
/// Field 13: `transcript_preview`
#[cfg_attr(
feature = "json",
serde(
rename = "transcriptPreview",
alias = "transcript_preview",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub transcript_preview: ::buffa::smol_str::SmolStr,
/// Field 14: `clip_count`
#[cfg_attr(
feature = "json",
serde(
rename = "clipCount",
alias = "clip_count",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub clip_count: u32,
/// Field 15: `fingerprint`
#[cfg_attr(
feature = "json",
serde(
rename = "fingerprint",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub fingerprint: ::buffa::alloc::vec::Vec<u32>,
/// Field 16: `gemini_enhanced`
#[cfg_attr(
feature = "json",
serde(
rename = "geminiEnhanced",
alias = "gemini_enhanced",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub gemini_enhanced: bool,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioSummary {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioSummary")
.field("prefilter_class", &self.prefilter_class)
.field("audio_type", &self.audio_type)
.field("scene", &self.scene)
.field("mood", &self.mood)
.field("voice", &self.voice)
.field("has_speech", &self.has_speech)
.field("has_music", &self.has_music)
.field("dominant_language", &self.dominant_language)
.field("speech_ratio", &self.speech_ratio)
.field("speaker_count", &self.speaker_count)
.field("loudness_lufs", &self.loudness_lufs)
.field("rms_db", &self.rms_db)
.field("transcript_preview", &self.transcript_preview)
.field("clip_count", &self.clip_count)
.field("fingerprint", &self.fingerprint)
.field("gemini_enhanced", &self.gemini_enhanced)
.finish()
}
}
impl AudioSummary {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioSummary";
}
impl ::buffa::DefaultInstance for AudioSummary {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioSummary> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioSummary {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioSummary";
const FULL_NAME: &'static str = "media.v1.AudioSummary";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioSummary";
}
impl ::buffa::Message for AudioSummary {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.prefilter_class.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.audio_type.is_set() {
let __slot = __cache.reserve();
let inner_size = self.audio_type.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.scene.is_set() {
let __slot = __cache.reserve();
let inner_size = self.scene.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.mood.is_set() {
let __slot = __cache.reserve();
let inner_size = self.mood.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.voice.is_set() {
let __slot = __cache.reserve();
let inner_size = self.voice.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.has_speech {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.has_music {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.dominant_language.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.dominant_language) as u32;
}
if self.speech_ratio.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.speaker_count != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.speaker_count) as u32;
}
if self.loudness_lufs.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.rms_db.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if !self.transcript_preview.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.transcript_preview)
as u32;
}
if self.clip_count != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.clip_count) as u32;
}
if !self.fingerprint.is_empty() {
let payload: u32 = self
.fingerprint
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u32)
.sum::<u32>();
size
+= 1u32 + ::buffa::encoding::varint_len(payload as u64) as u32 + payload;
}
if self.gemini_enhanced {
size += 2u32 + ::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 _;
{
let val = self.prefilter_class.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.audio_type.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.audio_type.write_to(__cache, buf);
}
if self.scene.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.scene.write_to(__cache, buf);
}
if self.mood.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.mood.write_to(__cache, buf);
}
if self.voice.is_set() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.voice.write_to(__cache, buf);
}
if self.has_speech {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.has_speech, buf);
}
if self.has_music {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.has_music, buf);
}
if !self.dominant_language.is_empty() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.dominant_language, buf);
}
if self.speech_ratio.to_bits() != 0u32 {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.speech_ratio, buf);
}
if self.speaker_count != 0u32 {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.speaker_count, buf);
}
if self.loudness_lufs.to_bits() != 0u32 {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.loudness_lufs, buf);
}
if self.rms_db.to_bits() != 0u32 {
::buffa::encoding::Tag::new(12u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.rms_db, buf);
}
if !self.transcript_preview.is_empty() {
::buffa::encoding::Tag::new(
13u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.transcript_preview, buf);
}
if self.clip_count != 0u32 {
::buffa::encoding::Tag::new(14u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.clip_count, buf);
}
if !self.fingerprint.is_empty() {
let payload: u32 = self
.fingerprint
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u32)
.sum::<u32>();
::buffa::encoding::Tag::new(
15u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(payload as u64, buf);
for &v in &self.fingerprint {
::buffa::types::encode_uint32(v, buf);
}
}
if self.gemini_enhanced {
::buffa::encoding::Tag::new(16u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.gemini_enhanced, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.prefilter_class = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.audio_type.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.scene.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.mood.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.voice.get_or_insert_default(),
buf,
depth,
)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.has_speech = ::buffa::types::decode_bool(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.has_music = ::buffa::types::decode_bool(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.dominant_language = ::buffa::types::decode_string_to(buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.speech_ratio = ::buffa::types::decode_float(buf)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.speaker_count = ::buffa::types::decode_uint32(buf)?;
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.loudness_lufs = ::buffa::types::decode_float(buf)?;
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.rms_db = ::buffa::types::decode_float(buf)?;
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.transcript_preview = ::buffa::types::decode_string_to(buf)?;
}
14u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 14u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.clip_count = ::buffa::types::decode_uint32(buf)?;
}
15u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
self.fingerprint.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.fingerprint
.push(::buffa::types::decode_uint32(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.fingerprint.push(::buffa::types::decode_uint32(buf)?);
} else {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
}
16u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 16u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.gemini_enhanced = ::buffa::types::decode_bool(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.prefilter_class = ::buffa::EnumValue::from(0);
self.audio_type = ::buffa::MessageField::none();
self.scene = ::buffa::MessageField::none();
self.mood = ::buffa::MessageField::none();
self.voice = ::buffa::MessageField::none();
self.has_speech = false;
self.has_music = false;
self.dominant_language = ::core::default::Default::default();
self.speech_ratio = 0f32;
self.speaker_count = 0u32;
self.loudness_lufs = 0f32;
self.rms_db = 0f32;
self.transcript_preview = ::core::default::Default::default();
self.clip_count = 0u32;
self.fingerprint.clear();
self.gemini_enhanced = false;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioSummary {
const PROTO_FQN: &'static str = "media.v1.AudioSummary";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioSummary {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_SUMMARY_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioSummary",
to_json: ::buffa::type_registry::any_to_json::<AudioSummary>,
from_json: ::buffa::type_registry::any_from_json::<AudioSummary>,
is_wkt: false,
};
/// ── Batch 9: audio aggregates (§6.5 audio aggregates table) ─────────────────
///
/// Source has wide deliberate tag bands (gaps 8–9, 11–19, 25–29, 38–39,
/// 43–49, 53–59, 62–69, 73–79, 83–89, 96–99, 102–109). Per §6.8 #3 these
/// are semantic groupings, NOT accidental holes: proto3 sparse field
/// numbers are emitted verbatim with NO `reserved` (no wire-compat
/// constraint; reserving dozens of numbers adds noise with no value).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioAnalysis {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `audio_id`
#[cfg_attr(
feature = "json",
serde(
rename = "audioId",
alias = "audio_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub audio_id: ::buffa::bytes::Bytes,
/// Field 3: `scene_id`
#[cfg_attr(
feature = "json",
serde(
rename = "sceneId",
alias = "scene_id",
with = "::buffa::json_helpers::opt_bytes",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_opt)
)]
pub scene_id: ::core::option::Option<::buffa::bytes::Bytes>,
/// Field 4: `kind`
#[cfg_attr(
feature = "json",
serde(
rename = "kind",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub kind: ::buffa::EnumValue<AudioClipKind>,
/// Field 5: `start_ms`
#[cfg_attr(
feature = "json",
serde(
rename = "startMs",
alias = "start_ms",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub start_ms: u32,
/// Field 6: `end_ms`
#[cfg_attr(
feature = "json",
serde(
rename = "endMs",
alias = "end_ms",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub end_ms: u32,
/// Field 7: `track_id`
#[cfg_attr(
feature = "json",
serde(
rename = "trackId",
alias = "track_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub track_id: ::buffa::bytes::Bytes,
/// Field 10: `ced_tags`
#[cfg_attr(
feature = "json",
serde(
rename = "cedTags",
alias = "ced_tags",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub ced_tags: ::buffa::alloc::vec::Vec<CedDetection>,
/// Field 20: `zs_audio_type`
#[cfg_attr(
feature = "json",
serde(
rename = "zsAudioType",
alias = "zs_audio_type",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub zs_audio_type: ::buffa::MessageField<TagConfidence>,
/// Field 21: `zs_scene`
#[cfg_attr(
feature = "json",
serde(
rename = "zsScene",
alias = "zs_scene",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub zs_scene: ::buffa::MessageField<TagConfidence>,
/// Field 22: `zs_mood`
#[cfg_attr(
feature = "json",
serde(
rename = "zsMood",
alias = "zs_mood",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub zs_mood: ::buffa::MessageField<TagConfidence>,
/// Field 23: `zs_sound_events`
#[cfg_attr(
feature = "json",
serde(
rename = "zsSoundEvents",
alias = "zs_sound_events",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub zs_sound_events: ::buffa::alloc::vec::Vec<TagConfidence>,
/// Field 24: `zs_voice`
#[cfg_attr(
feature = "json",
serde(
rename = "zsVoice",
alias = "zs_voice",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub zs_voice: ::buffa::MessageField<TagConfidence>,
/// Field 30: `description_en`
#[cfg_attr(
feature = "json",
serde(
rename = "descriptionEn",
alias = "description_en",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub description_en: ::buffa::smol_str::SmolStr,
/// Field 31: `description_zh`
#[cfg_attr(
feature = "json",
serde(
rename = "descriptionZh",
alias = "description_zh",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub description_zh: ::buffa::smol_str::SmolStr,
/// Field 32: `gemini_scene`
#[cfg_attr(
feature = "json",
serde(
rename = "geminiScene",
alias = "gemini_scene",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub gemini_scene: ::buffa::smol_str::SmolStr,
/// Field 33: `gemini_mood`
#[cfg_attr(
feature = "json",
serde(
rename = "geminiMood",
alias = "gemini_mood",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub gemini_mood: ::buffa::smol_str::SmolStr,
/// Field 34: `gemini_sound_sources`
#[cfg_attr(
feature = "json",
serde(
rename = "geminiSoundSources",
alias = "gemini_sound_sources",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub gemini_sound_sources: ::buffa::alloc::vec::Vec<SoundSource>,
/// Field 35: `gemini_foreground`
#[cfg_attr(
feature = "json",
serde(
rename = "geminiForeground",
alias = "gemini_foreground",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub gemini_foreground: ::buffa::smol_str::SmolStr,
/// Field 36: `gemini_background`
#[cfg_attr(
feature = "json",
serde(
rename = "geminiBackground",
alias = "gemini_background",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub gemini_background: ::buffa::smol_str::SmolStr,
/// Field 37: `gemini_enhanced`
#[cfg_attr(
feature = "json",
serde(
rename = "geminiEnhanced",
alias = "gemini_enhanced",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub gemini_enhanced: bool,
/// Field 40: `event_timeline`
#[cfg_attr(
feature = "json",
serde(
rename = "eventTimeline",
alias = "event_timeline",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub event_timeline: ::buffa::alloc::vec::Vec<AudioEvent>,
/// Field 41: `foreground_layer`
#[cfg_attr(
feature = "json",
serde(
rename = "foregroundLayer",
alias = "foreground_layer",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub foreground_layer: ::buffa::smol_str::SmolStr,
/// Field 42: `background_layer`
#[cfg_attr(
feature = "json",
serde(
rename = "backgroundLayer",
alias = "background_layer",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub background_layer: ::buffa::smol_str::SmolStr,
/// Field 50: `speech_ratio`
#[cfg_attr(
feature = "json",
serde(
rename = "speechRatio",
alias = "speech_ratio",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub speech_ratio: f32,
/// Field 51: `speaker_count`
#[cfg_attr(
feature = "json",
serde(
rename = "speakerCount",
alias = "speaker_count",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub speaker_count: u32,
/// Field 52: `speaker_segments`
#[cfg_attr(
feature = "json",
serde(
rename = "speakerSegments",
alias = "speaker_segments",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub speaker_segments: ::buffa::alloc::vec::Vec<SpeakerSegment>,
/// Field 60: `voice_gender`
#[cfg_attr(
feature = "json",
serde(
rename = "voiceGender",
alias = "voice_gender",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub voice_gender: ::buffa::MessageField<TagConfidence>,
/// Field 61: `voice_emotion`
#[cfg_attr(
feature = "json",
serde(
rename = "voiceEmotion",
alias = "voice_emotion",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub voice_emotion: ::buffa::MessageField<TagConfidence>,
/// Field 70: `transcript`
#[cfg_attr(
feature = "json",
serde(
rename = "transcript",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub transcript: ::buffa::smol_str::SmolStr,
/// Field 71: `transcript_segments`
#[cfg_attr(
feature = "json",
serde(
rename = "transcriptSegments",
alias = "transcript_segments",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub transcript_segments: ::buffa::alloc::vec::Vec<AudioTranscriptSegment>,
/// Field 72: `language`
#[cfg_attr(
feature = "json",
serde(
rename = "language",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub language: ::buffa::smol_str::SmolStr,
/// Field 80: `music_genre`
#[cfg_attr(
feature = "json",
serde(
rename = "musicGenre",
alias = "music_genre",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub music_genre: ::buffa::MessageField<TagConfidence>,
/// Field 81: `music_bpm`
#[cfg_attr(
feature = "json",
serde(
rename = "musicBpm",
alias = "music_bpm",
with = "::buffa::json_helpers::opt_float",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub music_bpm: ::core::option::Option<f32>,
/// Field 82: `music_instruments`
#[cfg_attr(
feature = "json",
serde(
rename = "musicInstruments",
alias = "music_instruments",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub music_instruments: ::buffa::alloc::vec::Vec<TagConfidence>,
/// Field 90: `loudness_lufs`
#[cfg_attr(
feature = "json",
serde(
rename = "loudnessLufs",
alias = "loudness_lufs",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub loudness_lufs: f32,
/// Field 91: `rms_db`
#[cfg_attr(
feature = "json",
serde(
rename = "rmsDb",
alias = "rms_db",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub rms_db: f32,
/// Field 92: `snr_db`
#[cfg_attr(
feature = "json",
serde(
rename = "snrDb",
alias = "snr_db",
with = "::buffa::json_helpers::opt_float",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
pub snr_db: ::core::option::Option<f32>,
/// Field 93: `has_sudden_onset`
#[cfg_attr(
feature = "json",
serde(
rename = "hasSuddenOnset",
alias = "has_sudden_onset",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub has_sudden_onset: bool,
/// Field 94: `energy_profile`
#[cfg_attr(
feature = "json",
serde(
rename = "energyProfile",
alias = "energy_profile",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub energy_profile: ::buffa::smol_str::SmolStr,
/// Field 95: `spectral_flatness`
#[cfg_attr(
feature = "json",
serde(
rename = "spectralFlatness",
alias = "spectral_flatness",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub spectral_flatness: f32,
/// Field 100: `fingerprint`
#[cfg_attr(
feature = "json",
serde(
rename = "fingerprint",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub fingerprint: ::buffa::alloc::vec::Vec<u32>,
/// Field 101: `prefilter_class`
#[cfg_attr(
feature = "json",
serde(
rename = "prefilterClass",
alias = "prefilter_class",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub prefilter_class: ::buffa::EnumValue<AudioPrefilterClass>,
/// Field 110: `has_speech`
#[cfg_attr(
feature = "json",
serde(
rename = "hasSpeech",
alias = "has_speech",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub has_speech: bool,
/// Field 111: `has_music`
#[cfg_attr(
feature = "json",
serde(
rename = "hasMusic",
alias = "has_music",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub has_music: bool,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioAnalysis {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioAnalysis")
.field("id", &self.id)
.field("audio_id", &self.audio_id)
.field("scene_id", &self.scene_id)
.field("kind", &self.kind)
.field("start_ms", &self.start_ms)
.field("end_ms", &self.end_ms)
.field("track_id", &self.track_id)
.field("ced_tags", &self.ced_tags)
.field("zs_audio_type", &self.zs_audio_type)
.field("zs_scene", &self.zs_scene)
.field("zs_mood", &self.zs_mood)
.field("zs_sound_events", &self.zs_sound_events)
.field("zs_voice", &self.zs_voice)
.field("description_en", &self.description_en)
.field("description_zh", &self.description_zh)
.field("gemini_scene", &self.gemini_scene)
.field("gemini_mood", &self.gemini_mood)
.field("gemini_sound_sources", &self.gemini_sound_sources)
.field("gemini_foreground", &self.gemini_foreground)
.field("gemini_background", &self.gemini_background)
.field("gemini_enhanced", &self.gemini_enhanced)
.field("event_timeline", &self.event_timeline)
.field("foreground_layer", &self.foreground_layer)
.field("background_layer", &self.background_layer)
.field("speech_ratio", &self.speech_ratio)
.field("speaker_count", &self.speaker_count)
.field("speaker_segments", &self.speaker_segments)
.field("voice_gender", &self.voice_gender)
.field("voice_emotion", &self.voice_emotion)
.field("transcript", &self.transcript)
.field("transcript_segments", &self.transcript_segments)
.field("language", &self.language)
.field("music_genre", &self.music_genre)
.field("music_bpm", &self.music_bpm)
.field("music_instruments", &self.music_instruments)
.field("loudness_lufs", &self.loudness_lufs)
.field("rms_db", &self.rms_db)
.field("snr_db", &self.snr_db)
.field("has_sudden_onset", &self.has_sudden_onset)
.field("energy_profile", &self.energy_profile)
.field("spectral_flatness", &self.spectral_flatness)
.field("fingerprint", &self.fingerprint)
.field("prefilter_class", &self.prefilter_class)
.field("has_speech", &self.has_speech)
.field("has_music", &self.has_music)
.finish()
}
}
impl AudioAnalysis {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioAnalysis";
}
impl AudioAnalysis {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::scene_id`] to `Some(value)`, consuming and returning `self`.
pub fn with_scene_id(mut self, value: impl Into<::buffa::bytes::Bytes>) -> Self {
self.scene_id = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::music_bpm`] to `Some(value)`, consuming and returning `self`.
pub fn with_music_bpm(mut self, value: f32) -> Self {
self.music_bpm = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::snr_db`] to `Some(value)`, consuming and returning `self`.
pub fn with_snr_db(mut self, value: f32) -> Self {
self.snr_db = Some(value);
self
}
}
impl ::buffa::DefaultInstance for AudioAnalysis {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioAnalysis> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioAnalysis {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioAnalysis";
const FULL_NAME: &'static str = "media.v1.AudioAnalysis";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioAnalysis";
}
impl ::buffa::Message for AudioAnalysis {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.audio_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.audio_id) as u32;
}
if let Some(ref v) = self.scene_id {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
{
let val = self.kind.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.start_ms != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.start_ms) as u32;
}
if self.end_ms != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.end_ms) as u32;
}
if !self.track_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.track_id) as u32;
}
for v in &self.ced_tags {
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;
}
if self.zs_audio_type.is_set() {
let __slot = __cache.reserve();
let inner_size = self.zs_audio_type.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.zs_scene.is_set() {
let __slot = __cache.reserve();
let inner_size = self.zs_scene.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.zs_mood.is_set() {
let __slot = __cache.reserve();
let inner_size = self.zs_mood.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.zs_sound_events {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.zs_voice.is_set() {
let __slot = __cache.reserve();
let inner_size = self.zs_voice.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.description_en.is_empty() {
size
+= 2u32
+ ::buffa::types::string_encoded_len(&self.description_en) as u32;
}
if !self.description_zh.is_empty() {
size
+= 2u32
+ ::buffa::types::string_encoded_len(&self.description_zh) as u32;
}
if !self.gemini_scene.is_empty() {
size += 2u32 + ::buffa::types::string_encoded_len(&self.gemini_scene) as u32;
}
if !self.gemini_mood.is_empty() {
size += 2u32 + ::buffa::types::string_encoded_len(&self.gemini_mood) as u32;
}
for v in &self.gemini_sound_sources {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.gemini_foreground.is_empty() {
size
+= 2u32
+ ::buffa::types::string_encoded_len(&self.gemini_foreground) as u32;
}
if !self.gemini_background.is_empty() {
size
+= 2u32
+ ::buffa::types::string_encoded_len(&self.gemini_background) as u32;
}
if self.gemini_enhanced {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
for v in &self.event_timeline {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.foreground_layer.is_empty() {
size
+= 2u32
+ ::buffa::types::string_encoded_len(&self.foreground_layer) as u32;
}
if !self.background_layer.is_empty() {
size
+= 2u32
+ ::buffa::types::string_encoded_len(&self.background_layer) as u32;
}
if self.speech_ratio.to_bits() != 0u32 {
size += 2u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.speaker_count != 0u32 {
size += 2u32 + ::buffa::types::uint32_encoded_len(self.speaker_count) as u32;
}
for v in &self.speaker_segments {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.voice_gender.is_set() {
let __slot = __cache.reserve();
let inner_size = self.voice_gender.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.voice_emotion.is_set() {
let __slot = __cache.reserve();
let inner_size = self.voice_emotion.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.transcript.is_empty() {
size += 2u32 + ::buffa::types::string_encoded_len(&self.transcript) as u32;
}
for v in &self.transcript_segments {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.language.is_empty() {
size += 2u32 + ::buffa::types::string_encoded_len(&self.language) as u32;
}
if self.music_genre.is_set() {
let __slot = __cache.reserve();
let inner_size = self.music_genre.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.music_bpm.is_some() {
size += 2u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
for v in &self.music_instruments {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.loudness_lufs.to_bits() != 0u32 {
size += 2u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.rms_db.to_bits() != 0u32 {
size += 2u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.snr_db.is_some() {
size += 2u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.has_sudden_onset {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.energy_profile.is_empty() {
size
+= 2u32
+ ::buffa::types::string_encoded_len(&self.energy_profile) as u32;
}
if self.spectral_flatness.to_bits() != 0u32 {
size += 2u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if !self.fingerprint.is_empty() {
let payload: u32 = self
.fingerprint
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u32)
.sum::<u32>();
size
+= 2u32 + ::buffa::encoding::varint_len(payload as u64) as u32 + payload;
}
{
let val = self.prefilter_class.to_i32();
if val != 0 {
size += 2u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.has_speech {
size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.has_music {
size += 2u32 + ::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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.audio_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.audio_id, buf);
}
if let Some(ref v) = self.scene_id {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
{
let val = self.kind.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.start_ms != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.start_ms, buf);
}
if self.end_ms != 0u32 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.end_ms, buf);
}
if !self.track_id.is_empty() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.track_id, buf);
}
for v in &self.ced_tags {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.zs_audio_type.is_set() {
::buffa::encoding::Tag::new(
20u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.zs_audio_type.write_to(__cache, buf);
}
if self.zs_scene.is_set() {
::buffa::encoding::Tag::new(
21u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.zs_scene.write_to(__cache, buf);
}
if self.zs_mood.is_set() {
::buffa::encoding::Tag::new(
22u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.zs_mood.write_to(__cache, buf);
}
for v in &self.zs_sound_events {
::buffa::encoding::Tag::new(
23u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.zs_voice.is_set() {
::buffa::encoding::Tag::new(
24u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.zs_voice.write_to(__cache, buf);
}
if !self.description_en.is_empty() {
::buffa::encoding::Tag::new(
30u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.description_en, buf);
}
if !self.description_zh.is_empty() {
::buffa::encoding::Tag::new(
31u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.description_zh, buf);
}
if !self.gemini_scene.is_empty() {
::buffa::encoding::Tag::new(
32u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.gemini_scene, buf);
}
if !self.gemini_mood.is_empty() {
::buffa::encoding::Tag::new(
33u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.gemini_mood, buf);
}
for v in &self.gemini_sound_sources {
::buffa::encoding::Tag::new(
34u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if !self.gemini_foreground.is_empty() {
::buffa::encoding::Tag::new(
35u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.gemini_foreground, buf);
}
if !self.gemini_background.is_empty() {
::buffa::encoding::Tag::new(
36u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.gemini_background, buf);
}
if self.gemini_enhanced {
::buffa::encoding::Tag::new(37u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.gemini_enhanced, buf);
}
for v in &self.event_timeline {
::buffa::encoding::Tag::new(
40u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if !self.foreground_layer.is_empty() {
::buffa::encoding::Tag::new(
41u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.foreground_layer, buf);
}
if !self.background_layer.is_empty() {
::buffa::encoding::Tag::new(
42u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.background_layer, buf);
}
if self.speech_ratio.to_bits() != 0u32 {
::buffa::encoding::Tag::new(50u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.speech_ratio, buf);
}
if self.speaker_count != 0u32 {
::buffa::encoding::Tag::new(51u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.speaker_count, buf);
}
for v in &self.speaker_segments {
::buffa::encoding::Tag::new(
52u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.voice_gender.is_set() {
::buffa::encoding::Tag::new(
60u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.voice_gender.write_to(__cache, buf);
}
if self.voice_emotion.is_set() {
::buffa::encoding::Tag::new(
61u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.voice_emotion.write_to(__cache, buf);
}
if !self.transcript.is_empty() {
::buffa::encoding::Tag::new(
70u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.transcript, buf);
}
for v in &self.transcript_segments {
::buffa::encoding::Tag::new(
71u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if !self.language.is_empty() {
::buffa::encoding::Tag::new(
72u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.language, buf);
}
if self.music_genre.is_set() {
::buffa::encoding::Tag::new(
80u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.music_genre.write_to(__cache, buf);
}
if let Some(v) = self.music_bpm {
::buffa::encoding::Tag::new(81u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(v, buf);
}
for v in &self.music_instruments {
::buffa::encoding::Tag::new(
82u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.loudness_lufs.to_bits() != 0u32 {
::buffa::encoding::Tag::new(90u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.loudness_lufs, buf);
}
if self.rms_db.to_bits() != 0u32 {
::buffa::encoding::Tag::new(91u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.rms_db, buf);
}
if let Some(v) = self.snr_db {
::buffa::encoding::Tag::new(92u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(v, buf);
}
if self.has_sudden_onset {
::buffa::encoding::Tag::new(93u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.has_sudden_onset, buf);
}
if !self.energy_profile.is_empty() {
::buffa::encoding::Tag::new(
94u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.energy_profile, buf);
}
if self.spectral_flatness.to_bits() != 0u32 {
::buffa::encoding::Tag::new(95u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.spectral_flatness, buf);
}
if !self.fingerprint.is_empty() {
let payload: u32 = self
.fingerprint
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u32)
.sum::<u32>();
::buffa::encoding::Tag::new(
100u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(payload as u64, buf);
for &v in &self.fingerprint {
::buffa::types::encode_uint32(v, buf);
}
}
{
let val = self.prefilter_class.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(101u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.has_speech {
::buffa::encoding::Tag::new(110u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.has_speech, buf);
}
if self.has_music {
::buffa::encoding::Tag::new(111u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.has_music, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.audio_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.scene_id = ::core::option::Option::Some(
::buffa::types::decode_bytes_to_bytes(buf)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.kind = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.start_ms = ::buffa::types::decode_uint32(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.end_ms = ::buffa::types::decode_uint32(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.track_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.ced_tags.push(elem);
}
20u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.zs_audio_type.get_or_insert_default(),
buf,
depth,
)?;
}
21u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 21u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.zs_scene.get_or_insert_default(),
buf,
depth,
)?;
}
22u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 22u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.zs_mood.get_or_insert_default(),
buf,
depth,
)?;
}
23u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 23u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.zs_sound_events.push(elem);
}
24u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 24u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.zs_voice.get_or_insert_default(),
buf,
depth,
)?;
}
30u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 30u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.description_en = ::buffa::types::decode_string_to(buf)?;
}
31u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 31u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.description_zh = ::buffa::types::decode_string_to(buf)?;
}
32u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 32u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.gemini_scene = ::buffa::types::decode_string_to(buf)?;
}
33u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 33u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.gemini_mood = ::buffa::types::decode_string_to(buf)?;
}
34u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 34u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.gemini_sound_sources.push(elem);
}
35u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 35u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.gemini_foreground = ::buffa::types::decode_string_to(buf)?;
}
36u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 36u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.gemini_background = ::buffa::types::decode_string_to(buf)?;
}
37u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 37u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.gemini_enhanced = ::buffa::types::decode_bool(buf)?;
}
40u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 40u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.event_timeline.push(elem);
}
41u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 41u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.foreground_layer = ::buffa::types::decode_string_to(buf)?;
}
42u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 42u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.background_layer = ::buffa::types::decode_string_to(buf)?;
}
50u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 50u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.speech_ratio = ::buffa::types::decode_float(buf)?;
}
51u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 51u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.speaker_count = ::buffa::types::decode_uint32(buf)?;
}
52u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 52u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.speaker_segments.push(elem);
}
60u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 60u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.voice_gender.get_or_insert_default(),
buf,
depth,
)?;
}
61u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 61u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.voice_emotion.get_or_insert_default(),
buf,
depth,
)?;
}
70u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 70u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.transcript = ::buffa::types::decode_string_to(buf)?;
}
71u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 71u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.transcript_segments.push(elem);
}
72u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 72u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.language = ::buffa::types::decode_string_to(buf)?;
}
80u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 80u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.music_genre.get_or_insert_default(),
buf,
depth,
)?;
}
81u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 81u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.music_bpm = ::core::option::Option::Some(
::buffa::types::decode_float(buf)?,
);
}
82u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 82u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.music_instruments.push(elem);
}
90u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 90u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.loudness_lufs = ::buffa::types::decode_float(buf)?;
}
91u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 91u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.rms_db = ::buffa::types::decode_float(buf)?;
}
92u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 92u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.snr_db = ::core::option::Option::Some(
::buffa::types::decode_float(buf)?,
);
}
93u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 93u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.has_sudden_onset = ::buffa::types::decode_bool(buf)?;
}
94u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 94u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.energy_profile = ::buffa::types::decode_string_to(buf)?;
}
95u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 95u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.spectral_flatness = ::buffa::types::decode_float(buf)?;
}
100u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
self.fingerprint.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.fingerprint
.push(::buffa::types::decode_uint32(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.fingerprint.push(::buffa::types::decode_uint32(buf)?);
} else {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 100u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
}
101u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 101u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.prefilter_class = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
110u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 110u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.has_speech = ::buffa::types::decode_bool(buf)?;
}
111u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 111u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.has_music = ::buffa::types::decode_bool(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.audio_id = ::buffa::bytes::Bytes::new();
self.scene_id = ::core::option::Option::None;
self.kind = ::buffa::EnumValue::from(0);
self.start_ms = 0u32;
self.end_ms = 0u32;
self.track_id = ::buffa::bytes::Bytes::new();
self.ced_tags.clear();
self.zs_audio_type = ::buffa::MessageField::none();
self.zs_scene = ::buffa::MessageField::none();
self.zs_mood = ::buffa::MessageField::none();
self.zs_sound_events.clear();
self.zs_voice = ::buffa::MessageField::none();
self.description_en = ::core::default::Default::default();
self.description_zh = ::core::default::Default::default();
self.gemini_scene = ::core::default::Default::default();
self.gemini_mood = ::core::default::Default::default();
self.gemini_sound_sources.clear();
self.gemini_foreground = ::core::default::Default::default();
self.gemini_background = ::core::default::Default::default();
self.gemini_enhanced = false;
self.event_timeline.clear();
self.foreground_layer = ::core::default::Default::default();
self.background_layer = ::core::default::Default::default();
self.speech_ratio = 0f32;
self.speaker_count = 0u32;
self.speaker_segments.clear();
self.voice_gender = ::buffa::MessageField::none();
self.voice_emotion = ::buffa::MessageField::none();
self.transcript = ::core::default::Default::default();
self.transcript_segments.clear();
self.language = ::core::default::Default::default();
self.music_genre = ::buffa::MessageField::none();
self.music_bpm = ::core::option::Option::None;
self.music_instruments.clear();
self.loudness_lufs = 0f32;
self.rms_db = 0f32;
self.snr_db = ::core::option::Option::None;
self.has_sudden_onset = false;
self.energy_profile = ::core::default::Default::default();
self.spectral_flatness = 0f32;
self.fingerprint.clear();
self.prefilter_class = ::buffa::EnumValue::from(0);
self.has_speech = false;
self.has_music = false;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioAnalysis {
const PROTO_FQN: &'static str = "media.v1.AudioAnalysis";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioAnalysis {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_ANALYSIS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioAnalysis",
to_json: ::buffa::type_registry::any_to_json::<AudioAnalysis>,
from_json: ::buffa::type_registry::any_from_json::<AudioAnalysis>,
is_wkt: false,
};
/// `language` is the src Iso6392B u32 newtype inlined as uint32 (varint,
/// §6.2/§6.8 #4). `stop_reason` bits (StopReason, §6.4): TIMECODE=0x01,
/// SILENT=0x02, FLATNESS=0x04, NO_SPEECH=0x08, LLM_NO_NET=0x10,
/// LLM_NO_CREDIT=0x20. `index_status` bits (ProcessingStage, §6.4):
/// EXTRACTED=0x01, CLASSIFIED=0x02, VAD_DONE=0x04, STT_DONE=0x08,
/// SPEAKER_DONE=0x10, LLM_DONE=0x20, TEXT_EMBED=0x40, CED_DONE=0x80,
/// CLAP_DONE=0x100, EBUR128_DONE=0x200, FPRINT_DONE=0x400. Source 1000s/
/// 2000s bands preserved verbatim; gap at 17 reserved (§6.8 #3).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct TrackRecord {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `audio_id`
#[cfg_attr(
feature = "json",
serde(
rename = "audioId",
alias = "audio_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub audio_id: ::buffa::bytes::Bytes,
/// Field 3: `track_index`
#[cfg_attr(
feature = "json",
serde(
rename = "trackIndex",
alias = "track_index",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub track_index: u32,
/// Field 4: `codec`
#[cfg_attr(
feature = "json",
serde(
rename = "codec",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub codec: ::buffa::EnumValue<AudioCodec>,
/// Field 5: `sample_format`
#[cfg_attr(
feature = "json",
serde(
rename = "sampleFormat",
alias = "sample_format",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub sample_format: ::buffa::EnumValue<AudioSampleFormat>,
/// Field 6: `sample_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "sampleRate",
alias = "sample_rate",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub sample_rate: u32,
/// Field 7: `channels`
#[cfg_attr(
feature = "json",
serde(
rename = "channels",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub channels: u32,
/// Field 8: `channel_layout`
#[cfg_attr(
feature = "json",
serde(
rename = "channelLayout",
alias = "channel_layout",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub channel_layout: ::buffa::EnumValue<ChannelLayoutKind>,
/// Field 9: `bit_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "bitRate",
alias = "bit_rate",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub bit_rate: u64,
/// Field 10: `bit_depth`
#[cfg_attr(
feature = "json",
serde(
rename = "bitDepth",
alias = "bit_depth",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub bit_depth: u32,
/// Field 11: `total_pts`
#[cfg_attr(
feature = "json",
serde(
rename = "totalPts",
alias = "total_pts",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub total_pts: i64,
/// Field 12: `time_base`
#[cfg_attr(
feature = "json",
serde(
rename = "timeBase",
alias = "time_base",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub time_base: ::buffa::MessageField<::mediatime::Timebase>,
/// Field 13: `language`
#[cfg_attr(
feature = "json",
serde(
rename = "language",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub language: u32,
/// Field 14: `timecode`
#[cfg_attr(
feature = "json",
serde(
rename = "timecode",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub timecode: ::buffa::MessageField<Timecode>,
/// Field 15: `classification`
#[cfg_attr(
feature = "json",
serde(
rename = "classification",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub classification: ::buffa::EnumValue<TrackClassificationType>,
/// Field 16: `stop_reason`
#[cfg_attr(
feature = "json",
serde(
rename = "stopReason",
alias = "stop_reason",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub stop_reason: u32,
/// Field 17: `tags`
#[cfg_attr(
feature = "json",
serde(
rename = "tags",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub tags: ::buffa::alloc::vec::Vec<TrackTag>,
/// Field 1000: `ebur_128`
#[cfg_attr(
feature = "json",
serde(
rename = "ebur128",
alias = "ebur_128",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub ebur_128: ::buffa::MessageField<Ebur128>,
/// Field 1001: `clap`
#[cfg_attr(
feature = "json",
serde(
rename = "clap",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub clap: ::buffa::MessageField<Clap>,
/// Field 1002: `ced`
#[cfg_attr(
feature = "json",
serde(
rename = "ced",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub ced: ::buffa::MessageField<Ced>,
/// Field 1003: `chromaprint`
#[cfg_attr(
feature = "json",
serde(
rename = "chromaprint",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub chromaprint: ::buffa::MessageField<Chromaprint>,
/// Field 2000: `index_status`
#[cfg_attr(
feature = "json",
serde(
rename = "indexStatus",
alias = "index_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub index_status: u32,
/// Field 2001: `index_error`
#[cfg_attr(
feature = "json",
serde(
rename = "indexError",
alias = "index_error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub index_error: ::buffa::MessageField<ErrorInfo>,
/// Field 2002: `error_status`
#[cfg_attr(
feature = "json",
serde(
rename = "errorStatus",
alias = "error_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub error_status: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for TrackRecord {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("TrackRecord")
.field("id", &self.id)
.field("audio_id", &self.audio_id)
.field("track_index", &self.track_index)
.field("codec", &self.codec)
.field("sample_format", &self.sample_format)
.field("sample_rate", &self.sample_rate)
.field("channels", &self.channels)
.field("channel_layout", &self.channel_layout)
.field("bit_rate", &self.bit_rate)
.field("bit_depth", &self.bit_depth)
.field("total_pts", &self.total_pts)
.field("time_base", &self.time_base)
.field("language", &self.language)
.field("timecode", &self.timecode)
.field("classification", &self.classification)
.field("stop_reason", &self.stop_reason)
.field("tags", &self.tags)
.field("ebur_128", &self.ebur_128)
.field("clap", &self.clap)
.field("ced", &self.ced)
.field("chromaprint", &self.chromaprint)
.field("index_status", &self.index_status)
.field("index_error", &self.index_error)
.field("error_status", &self.error_status)
.finish()
}
}
impl TrackRecord {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TrackRecord";
}
impl ::buffa::DefaultInstance for TrackRecord {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<TrackRecord> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for TrackRecord {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "TrackRecord";
const FULL_NAME: &'static str = "media.v1.TrackRecord";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.TrackRecord";
}
impl ::buffa::Message for TrackRecord {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if !self.audio_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.audio_id) as u32;
}
if self.track_index != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.track_index) as u32;
}
{
let val = self.codec.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
{
let val = self.sample_format.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.sample_rate != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.sample_rate) as u32;
}
if self.channels != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.channels) as u32;
}
{
let val = self.channel_layout.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.bit_rate != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.bit_rate) as u32;
}
if self.bit_depth != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.bit_depth) as u32;
}
if self.total_pts != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.total_pts) as u32;
}
if self.time_base.is_set() {
let __slot = __cache.reserve();
let inner_size = self.time_base.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.language != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.language) as u32;
}
if self.timecode.is_set() {
let __slot = __cache.reserve();
let inner_size = self.timecode.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
{
let val = self.classification.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.stop_reason != 0u32 {
size += 2u32 + ::buffa::types::uint32_encoded_len(self.stop_reason) as u32;
}
for v in &self.tags {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.ebur_128.is_set() {
let __slot = __cache.reserve();
let inner_size = self.ebur_128.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.clap.is_set() {
let __slot = __cache.reserve();
let inner_size = self.clap.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.ced.is_set() {
let __slot = __cache.reserve();
let inner_size = self.ced.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.chromaprint.is_set() {
let __slot = __cache.reserve();
let inner_size = self.chromaprint.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.index_status != 0u32 {
size += 2u32 + ::buffa::types::uint32_encoded_len(self.index_status) as u32;
}
if self.index_error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.index_error.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.error_status != 0u32 {
size += 2u32 + ::buffa::types::uint32_encoded_len(self.error_status) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if !self.audio_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.audio_id, buf);
}
if self.track_index != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.track_index, buf);
}
{
let val = self.codec.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
{
let val = self.sample_format.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.sample_rate != 0u32 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.sample_rate, buf);
}
if self.channels != 0u32 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.channels, buf);
}
{
let val = self.channel_layout.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.bit_rate != 0u64 {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.bit_rate, buf);
}
if self.bit_depth != 0u32 {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.bit_depth, buf);
}
if self.total_pts != 0i64 {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.total_pts, buf);
}
if self.time_base.is_set() {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.time_base.write_to(__cache, buf);
}
if self.language != 0u32 {
::buffa::encoding::Tag::new(13u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.language, buf);
}
if self.timecode.is_set() {
::buffa::encoding::Tag::new(
14u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.timecode.write_to(__cache, buf);
}
{
let val = self.classification.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(15u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.stop_reason != 0u32 {
::buffa::encoding::Tag::new(16u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.stop_reason, buf);
}
for v in &self.tags {
::buffa::encoding::Tag::new(
17u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.ebur_128.is_set() {
::buffa::encoding::Tag::new(
1000u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.ebur_128.write_to(__cache, buf);
}
if self.clap.is_set() {
::buffa::encoding::Tag::new(
1001u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.clap.write_to(__cache, buf);
}
if self.ced.is_set() {
::buffa::encoding::Tag::new(
1002u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.ced.write_to(__cache, buf);
}
if self.chromaprint.is_set() {
::buffa::encoding::Tag::new(
1003u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.chromaprint.write_to(__cache, buf);
}
if self.index_status != 0u32 {
::buffa::encoding::Tag::new(2000u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.index_status, buf);
}
if self.index_error.is_set() {
::buffa::encoding::Tag::new(
2001u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.index_error.write_to(__cache, buf);
}
if self.error_status != 0u32 {
::buffa::encoding::Tag::new(2002u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.error_status, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.audio_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.track_index = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.codec = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.sample_format = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.sample_rate = ::buffa::types::decode_uint32(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.channels = ::buffa::types::decode_uint32(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.channel_layout = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.bit_rate = ::buffa::types::decode_uint64(buf)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.bit_depth = ::buffa::types::decode_uint32(buf)?;
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_pts = ::buffa::types::decode_int64(buf)?;
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.time_base.get_or_insert_default(),
buf,
depth,
)?;
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.language = ::buffa::types::decode_uint32(buf)?;
}
14u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 14u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.timecode.get_or_insert_default(),
buf,
depth,
)?;
}
15u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.classification = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
16u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 16u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.stop_reason = ::buffa::types::decode_uint32(buf)?;
}
17u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 17u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.tags.push(elem);
}
1000u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1000u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.ebur_128.get_or_insert_default(),
buf,
depth,
)?;
}
1001u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1001u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.clap.get_or_insert_default(),
buf,
depth,
)?;
}
1002u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1002u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.ced.get_or_insert_default(),
buf,
depth,
)?;
}
1003u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1003u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.chromaprint.get_or_insert_default(),
buf,
depth,
)?;
}
2000u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2000u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.index_status = ::buffa::types::decode_uint32(buf)?;
}
2001u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2001u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.index_error.get_or_insert_default(),
buf,
depth,
)?;
}
2002u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2002u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.error_status = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.audio_id = ::buffa::bytes::Bytes::new();
self.track_index = 0u32;
self.codec = ::buffa::EnumValue::from(0);
self.sample_format = ::buffa::EnumValue::from(0);
self.sample_rate = 0u32;
self.channels = 0u32;
self.channel_layout = ::buffa::EnumValue::from(0);
self.bit_rate = 0u64;
self.bit_depth = 0u32;
self.total_pts = 0i64;
self.time_base = ::buffa::MessageField::none();
self.language = 0u32;
self.timecode = ::buffa::MessageField::none();
self.classification = ::buffa::EnumValue::from(0);
self.stop_reason = 0u32;
self.tags.clear();
self.ebur_128 = ::buffa::MessageField::none();
self.clap = ::buffa::MessageField::none();
self.ced = ::buffa::MessageField::none();
self.chromaprint = ::buffa::MessageField::none();
self.index_status = 0u32;
self.index_error = ::buffa::MessageField::none();
self.error_status = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for TrackRecord {
const PROTO_FQN: &'static str = "media.v1.TrackRecord";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for TrackRecord {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __TRACK_RECORD_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.TrackRecord",
to_json: ::buffa::type_registry::any_to_json::<TrackRecord>,
from_json: ::buffa::type_registry::any_from_json::<TrackRecord>,
is_wkt: false,
};
/// `index_status` bits (AudioIndexStatus, §6.4): PROBED=0x01,
/// ANALYZED_LOCAL=0x02, TRANSCRIPTED=0x04, GEMINI_ENHANCED=0x08,
/// AUDIO_EMBEDDING_FINISHED=0x10, DESCRIPTION_EMBEDDING_FINISHED=0x20.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Audio {
/// Field 1: `meta`
#[cfg_attr(
feature = "json",
serde(
rename = "meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub meta: ::buffa::MessageField<AudioMeta>,
/// Field 2: `analyses`
#[cfg_attr(
feature = "json",
serde(
rename = "analyses",
with = "::buffa::json_helpers::proto_seq",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_vec)
)]
pub analyses: ::buffa::alloc::vec::Vec<::buffa::bytes::Bytes>,
/// Field 3: `summary`
#[cfg_attr(
feature = "json",
serde(
rename = "summary",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub summary: ::buffa::MessageField<AudioSummary>,
/// Field 4: `index_status`
#[cfg_attr(
feature = "json",
serde(
rename = "indexStatus",
alias = "index_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub index_status: u32,
/// Field 5: `index_error`
#[cfg_attr(
feature = "json",
serde(
rename = "indexError",
alias = "index_error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub index_error: ::buffa::MessageField<ErrorInfo>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Audio {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Audio")
.field("meta", &self.meta)
.field("analyses", &self.analyses)
.field("summary", &self.summary)
.field("index_status", &self.index_status)
.field("index_error", &self.index_error)
.finish()
}
}
impl Audio {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Audio";
}
impl ::buffa::DefaultInstance for Audio {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Audio> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Audio {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Audio";
const FULL_NAME: &'static str = "media.v1.Audio";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Audio";
}
impl ::buffa::Message for Audio {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.analyses {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
if self.summary.is_set() {
let __slot = __cache.reserve();
let inner_size = self.summary.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.index_status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.index_status) as u32;
}
if self.index_error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.index_error.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.meta.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.meta.write_to(__cache, buf);
}
for v in &self.analyses {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
if self.summary.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.summary.write_to(__cache, buf);
}
if self.index_status != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.index_status, buf);
}
if self.index_error.is_set() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.index_error.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.meta.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.analyses.push(::buffa::types::decode_bytes_to_bytes(buf)?);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.summary.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.index_status = ::buffa::types::decode_uint32(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.index_error.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.meta = ::buffa::MessageField::none();
self.analyses.clear();
self.summary = ::buffa::MessageField::none();
self.index_status = 0u32;
self.index_error = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Audio {
const PROTO_FQN: &'static str = "media.v1.Audio";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Audio {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Audio",
to_json: ::buffa::type_registry::any_to_json::<Audio>,
from_json: ::buffa::type_registry::any_from_json::<Audio>,
is_wkt: false,
};
/// `disposition` bits (AudioTrackDisposition, §6.4): DEFAULT=0x1, DUB=0x2,
/// ORIGINAL=0x4, COMMENT=0x8, LYRICS=0x10, KARAOKE=0x20, FORCED=0x40,
/// HEARING_IMPAIRED=0x80, VISUAL_IMPAIRED=0x100, CLEAN_EFFECTS=0x200,
/// ATTACHED_PIC=0x400, TIMED_THUMBNAILS=0x800, NON_DIEGETIC=0x1000
/// (gap at 0x2000-0x8000), CAPTIONS=0x10000, DESCRIPTIONS=0x20000,
/// METADATA=0x40000, DEPENDENT=0x80000, STILL_IMAGE=0x100000,
/// MULTILAYER=0x200000.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioTrack {
/// Field 1: `meta`
#[cfg_attr(
feature = "json",
serde(
rename = "meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub meta: ::buffa::MessageField<AudioTrackMeta>,
/// Field 2: `stream`
#[cfg_attr(
feature = "json",
serde(
rename = "stream",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub stream: ::buffa::MessageField<AudioStreamMeta>,
/// Field 3: `disposition`
#[cfg_attr(
feature = "json",
serde(
rename = "disposition",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub disposition: u32,
/// Field 4: `role`
#[cfg_attr(
feature = "json",
serde(
rename = "role",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub role: ::buffa::EnumValue<AudioTrackRole>,
/// Field 5: `is_primary`
#[cfg_attr(
feature = "json",
serde(
rename = "isPrimary",
alias = "is_primary",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub is_primary: bool,
/// Field 6: `auto_selected`
#[cfg_attr(
feature = "json",
serde(
rename = "autoSelected",
alias = "auto_selected",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)
)]
pub auto_selected: bool,
/// Field 7: `selection_reason`
#[cfg_attr(
feature = "json",
serde(
rename = "selectionReason",
alias = "selection_reason",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub selection_reason: ::buffa::smol_str::SmolStr,
/// Field 8: `audio_id`
#[cfg_attr(
feature = "json",
serde(
rename = "audioId",
alias = "audio_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub audio_id: ::buffa::bytes::Bytes,
/// Field 9: `index_error`
#[cfg_attr(
feature = "json",
serde(
rename = "indexError",
alias = "index_error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub index_error: ::buffa::MessageField<ErrorInfo>,
/// Container `AVDictionary` entries from this stream's metadata,
/// with the hoisted keys (the `*Tags`-recognized set) already consumed
/// into dedicated columns. Insertion-ordered. Domain rev 8.
///
/// Field 10: `metadata`
#[cfg_attr(
feature = "json",
serde(
rename = "metadata",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub metadata: ::buffa::alloc::vec::Vec<KeyValue>,
/// Container-tagged ReplayGain normalization recommendation (FFmpeg
/// `AV_PKT_DATA_REPLAYGAIN` side data / `REPLAYGAIN_TRACK_*` /
/// `REPLAYGAIN_ALBUM_*` `AVDictionary` keys). Distinct from Ebur128
/// measurement; see `ReplayGain` message above. Domain rev 5.
///
/// Field 11: `replay_gain`
#[cfg_attr(
feature = "json",
serde(
rename = "replayGain",
alias = "replay_gain",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub replay_gain: ::buffa::MessageField<ReplayGain>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioTrack {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioTrack")
.field("meta", &self.meta)
.field("stream", &self.stream)
.field("disposition", &self.disposition)
.field("role", &self.role)
.field("is_primary", &self.is_primary)
.field("auto_selected", &self.auto_selected)
.field("selection_reason", &self.selection_reason)
.field("audio_id", &self.audio_id)
.field("index_error", &self.index_error)
.field("metadata", &self.metadata)
.field("replay_gain", &self.replay_gain)
.finish()
}
}
impl AudioTrack {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioTrack";
}
impl ::buffa::DefaultInstance for AudioTrack {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioTrack> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioTrack {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioTrack";
const FULL_NAME: &'static str = "media.v1.AudioTrack";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioTrack";
}
impl ::buffa::Message for AudioTrack {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.stream.is_set() {
let __slot = __cache.reserve();
let inner_size = self.stream.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.disposition != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.disposition) as u32;
}
{
let val = self.role.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.is_primary {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.auto_selected {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.selection_reason.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.selection_reason) as u32;
}
if !self.audio_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.audio_id) as u32;
}
if self.index_error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.index_error.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.metadata {
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;
}
if self.replay_gain.is_set() {
let __slot = __cache.reserve();
let inner_size = self.replay_gain.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.meta.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.meta.write_to(__cache, buf);
}
if self.stream.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.stream.write_to(__cache, buf);
}
if self.disposition != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.disposition, buf);
}
{
let val = self.role.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.is_primary {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.is_primary, buf);
}
if self.auto_selected {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.auto_selected, buf);
}
if !self.selection_reason.is_empty() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.selection_reason, buf);
}
if !self.audio_id.is_empty() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.audio_id, buf);
}
if self.index_error.is_set() {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.index_error.write_to(__cache, buf);
}
for v in &self.metadata {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.replay_gain.is_set() {
::buffa::encoding::Tag::new(
11u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.replay_gain.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.meta.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.stream.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.disposition = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.role = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.is_primary = ::buffa::types::decode_bool(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.auto_selected = ::buffa::types::decode_bool(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.selection_reason = ::buffa::types::decode_string_to(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.audio_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.index_error.get_or_insert_default(),
buf,
depth,
)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.metadata.push(elem);
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.replay_gain.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.meta = ::buffa::MessageField::none();
self.stream = ::buffa::MessageField::none();
self.disposition = 0u32;
self.role = ::buffa::EnumValue::from(0);
self.is_primary = false;
self.auto_selected = false;
self.selection_reason = ::core::default::Default::default();
self.audio_id = ::buffa::bytes::Bytes::new();
self.index_error = ::buffa::MessageField::none();
self.metadata.clear();
self.replay_gain = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioTrack {
const PROTO_FQN: &'static str = "media.v1.AudioTrack";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioTrack {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_TRACK_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioTrack",
to_json: ::buffa::type_registry::any_to_json::<AudioTrack>,
from_json: ::buffa::type_registry::any_from_json::<AudioTrack>,
is_wkt: false,
};
/// ── Batch 10: audio file record (§6.5 audio aggregates table; §6.8 #1) ──────
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioCoverArt {
/// Field 1: `path`
#[cfg_attr(
feature = "json",
serde(
rename = "path",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub path: ::buffa::MessageField<Location>,
/// Field 2: `mime`
#[cfg_attr(
feature = "json",
serde(
rename = "mime",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub mime: ::buffa::smol_str::SmolStr,
/// Field 3: `dimensions`
#[cfg_attr(
feature = "json",
serde(
rename = "dimensions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub dimensions: ::buffa::MessageField<Dimensions>,
/// Field 4: `size`
#[cfg_attr(
feature = "json",
serde(
rename = "size",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub size: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioCoverArt {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioCoverArt")
.field("path", &self.path)
.field("mime", &self.mime)
.field("dimensions", &self.dimensions)
.field("size", &self.size)
.finish()
}
}
impl AudioCoverArt {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioCoverArt";
}
impl ::buffa::DefaultInstance for AudioCoverArt {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioCoverArt> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioCoverArt {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioCoverArt";
const FULL_NAME: &'static str = "media.v1.AudioCoverArt";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioCoverArt";
}
impl ::buffa::Message for AudioCoverArt {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.path.is_set() {
let __slot = __cache.reserve();
let inner_size = self.path.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.mime.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.mime) as u32;
}
if self.dimensions.is_set() {
let __slot = __cache.reserve();
let inner_size = self.dimensions.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.size != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.size) 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.path.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.path.write_to(__cache, buf);
}
if !self.mime.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.mime, buf);
}
if self.dimensions.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.dimensions.write_to(__cache, buf);
}
if self.size != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.size, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.path.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.mime = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.dimensions.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.size = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.path = ::buffa::MessageField::none();
self.mime = ::core::default::Default::default();
self.dimensions = ::buffa::MessageField::none();
self.size = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioCoverArt {
const PROTO_FQN: &'static str = "media.v1.AudioCoverArt";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioCoverArt {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_COVER_ART_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioCoverArt",
to_json: ::buffa::type_registry::any_to_json::<AudioCoverArt>,
from_json: ::buffa::type_registry::any_from_json::<AudioCoverArt>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct AudioFileRecord {
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// Field 2: `checksum`
#[cfg_attr(
feature = "json",
serde(
rename = "checksum",
with = "::buffa::json_helpers::opt_bytes",
skip_serializing_if = "::core::option::Option::is_none"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_opt)
)]
pub checksum: ::core::option::Option<::buffa::bytes::Bytes>,
/// Field 3: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 4: `format`
#[cfg_attr(
feature = "json",
serde(
rename = "format",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub format: ::buffa::EnumValue<AudioFormat>,
/// Field 5: `size`
#[cfg_attr(
feature = "json",
serde(
rename = "size",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub size: u64,
/// Field 6: `total_pts`
#[cfg_attr(
feature = "json",
serde(
rename = "totalPts",
alias = "total_pts",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub total_pts: i64,
/// Field 7: `frame_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "frameRate",
alias = "frame_rate",
with = "::buffa::json_helpers::double",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f64"
)
)]
pub frame_rate: f64,
/// Field 8: `bit_rate`
#[cfg_attr(
feature = "json",
serde(
rename = "bitRate",
alias = "bit_rate",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub bit_rate: u64,
/// Field 9: `time_base`
#[cfg_attr(
feature = "json",
serde(
rename = "timeBase",
alias = "time_base",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub time_base: ::buffa::MessageField<::mediatime::Timebase>,
/// Field 10: `container_format`
#[cfg_attr(
feature = "json",
serde(
rename = "containerFormat",
alias = "container_format",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)
)]
pub container_format: ::buffa::EnumValue<AudioContainerFormat>,
/// Field 11: `stream_count`
#[cfg_attr(
feature = "json",
serde(
rename = "streamCount",
alias = "stream_count",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub stream_count: u32,
/// Field 12: `title`
#[cfg_attr(
feature = "json",
serde(
rename = "title",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub title: ::buffa::smol_str::SmolStr,
/// Field 13: `artist`
#[cfg_attr(
feature = "json",
serde(
rename = "artist",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub artist: ::buffa::smol_str::SmolStr,
/// Field 14: `album_artist`
#[cfg_attr(
feature = "json",
serde(
rename = "albumArtist",
alias = "album_artist",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub album_artist: ::buffa::smol_str::SmolStr,
/// Field 15: `album`
#[cfg_attr(
feature = "json",
serde(
rename = "album",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub album: ::buffa::smol_str::SmolStr,
/// Field 16: `genre`
#[cfg_attr(
feature = "json",
serde(
rename = "genre",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub genre: ::buffa::smol_str::SmolStr,
/// Field 17: `composer`
#[cfg_attr(
feature = "json",
serde(
rename = "composer",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub composer: ::buffa::smol_str::SmolStr,
/// Field 18: `performer`
#[cfg_attr(
feature = "json",
serde(
rename = "performer",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub performer: ::buffa::smol_str::SmolStr,
/// Field 19: `date`
#[cfg_attr(
feature = "json",
serde(
rename = "date",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub date: ::buffa::smol_str::SmolStr,
/// Field 20: `track_number`
#[cfg_attr(
feature = "json",
serde(
rename = "trackNumber",
alias = "track_number",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub track_number: u32,
/// Field 21: `total_tracks`
#[cfg_attr(
feature = "json",
serde(
rename = "totalTracks",
alias = "total_tracks",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub total_tracks: u32,
/// Field 22: `disc_number`
#[cfg_attr(
feature = "json",
serde(
rename = "discNumber",
alias = "disc_number",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub disc_number: u32,
/// Field 23: `total_discs`
#[cfg_attr(
feature = "json",
serde(
rename = "totalDiscs",
alias = "total_discs",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub total_discs: u32,
/// Field 24: `comment`
#[cfg_attr(
feature = "json",
serde(
rename = "comment",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub comment: ::buffa::smol_str::SmolStr,
/// Field 25: `lyrics`
#[cfg_attr(
feature = "json",
serde(
rename = "lyrics",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub lyrics: ::buffa::smol_str::SmolStr,
/// Field 26: `tag_types`
#[cfg_attr(
feature = "json",
serde(
rename = "tagTypes",
alias = "tag_types",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub tag_types: ::buffa::alloc::vec::Vec<::buffa::smol_str::SmolStr>,
/// Field 27: `cover_art`
#[cfg_attr(
feature = "json",
serde(
rename = "coverArt",
alias = "cover_art",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub cover_art: ::buffa::MessageField<AudioCoverArt>,
/// Field 28: `created_at`
#[cfg_attr(
feature = "json",
serde(
rename = "createdAt",
alias = "created_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub created_at: i64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for AudioFileRecord {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AudioFileRecord")
.field("id", &self.id)
.field("checksum", &self.checksum)
.field("name", &self.name)
.field("format", &self.format)
.field("size", &self.size)
.field("total_pts", &self.total_pts)
.field("frame_rate", &self.frame_rate)
.field("bit_rate", &self.bit_rate)
.field("time_base", &self.time_base)
.field("container_format", &self.container_format)
.field("stream_count", &self.stream_count)
.field("title", &self.title)
.field("artist", &self.artist)
.field("album_artist", &self.album_artist)
.field("album", &self.album)
.field("genre", &self.genre)
.field("composer", &self.composer)
.field("performer", &self.performer)
.field("date", &self.date)
.field("track_number", &self.track_number)
.field("total_tracks", &self.total_tracks)
.field("disc_number", &self.disc_number)
.field("total_discs", &self.total_discs)
.field("comment", &self.comment)
.field("lyrics", &self.lyrics)
.field("tag_types", &self.tag_types)
.field("cover_art", &self.cover_art)
.field("created_at", &self.created_at)
.finish()
}
}
impl AudioFileRecord {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioFileRecord";
}
impl AudioFileRecord {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
///Sets [`Self::checksum`] to `Some(value)`, consuming and returning `self`.
pub fn with_checksum(mut self, value: impl Into<::buffa::bytes::Bytes>) -> Self {
self.checksum = Some(value.into());
self
}
}
impl ::buffa::DefaultInstance for AudioFileRecord {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<AudioFileRecord> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for AudioFileRecord {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "AudioFileRecord";
const FULL_NAME: &'static str = "media.v1.AudioFileRecord";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.AudioFileRecord";
}
impl ::buffa::Message for AudioFileRecord {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if let Some(ref v) = self.checksum {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
{
let val = self.format.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.size != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.size) as u32;
}
if self.total_pts != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.total_pts) as u32;
}
if self.frame_rate.to_bits() != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
if self.bit_rate != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.bit_rate) as u32;
}
if self.time_base.is_set() {
let __slot = __cache.reserve();
let inner_size = self.time_base.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
{
let val = self.container_format.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.stream_count != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.stream_count) as u32;
}
if !self.title.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.title) as u32;
}
if !self.artist.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.artist) as u32;
}
if !self.album_artist.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.album_artist) as u32;
}
if !self.album.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.album) as u32;
}
if !self.genre.is_empty() {
size += 2u32 + ::buffa::types::string_encoded_len(&self.genre) as u32;
}
if !self.composer.is_empty() {
size += 2u32 + ::buffa::types::string_encoded_len(&self.composer) as u32;
}
if !self.performer.is_empty() {
size += 2u32 + ::buffa::types::string_encoded_len(&self.performer) as u32;
}
if !self.date.is_empty() {
size += 2u32 + ::buffa::types::string_encoded_len(&self.date) as u32;
}
if self.track_number != 0u32 {
size += 2u32 + ::buffa::types::uint32_encoded_len(self.track_number) as u32;
}
if self.total_tracks != 0u32 {
size += 2u32 + ::buffa::types::uint32_encoded_len(self.total_tracks) as u32;
}
if self.disc_number != 0u32 {
size += 2u32 + ::buffa::types::uint32_encoded_len(self.disc_number) as u32;
}
if self.total_discs != 0u32 {
size += 2u32 + ::buffa::types::uint32_encoded_len(self.total_discs) as u32;
}
if !self.comment.is_empty() {
size += 2u32 + ::buffa::types::string_encoded_len(&self.comment) as u32;
}
if !self.lyrics.is_empty() {
size += 2u32 + ::buffa::types::string_encoded_len(&self.lyrics) as u32;
}
for v in &self.tag_types {
size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.cover_art.is_set() {
let __slot = __cache.reserve();
let inner_size = self.cover_art.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 2u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.created_at != 0i64 {
size += 2u32 + ::buffa::types::int64_encoded_len(self.created_at) 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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if let Some(ref v) = self.checksum {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
{
let val = self.format.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.size != 0u64 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.size, buf);
}
if self.total_pts != 0i64 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.total_pts, buf);
}
if self.frame_rate.to_bits() != 0u64 {
::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Fixed64)
.encode(buf);
::buffa::types::encode_double(self.frame_rate, buf);
}
if self.bit_rate != 0u64 {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.bit_rate, buf);
}
if self.time_base.is_set() {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.time_base.write_to(__cache, buf);
}
{
let val = self.container_format.to_i32();
if val != 0 {
::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(val, buf);
}
}
if self.stream_count != 0u32 {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.stream_count, buf);
}
if !self.title.is_empty() {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.title, buf);
}
if !self.artist.is_empty() {
::buffa::encoding::Tag::new(
13u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.artist, buf);
}
if !self.album_artist.is_empty() {
::buffa::encoding::Tag::new(
14u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.album_artist, buf);
}
if !self.album.is_empty() {
::buffa::encoding::Tag::new(
15u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.album, buf);
}
if !self.genre.is_empty() {
::buffa::encoding::Tag::new(
16u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.genre, buf);
}
if !self.composer.is_empty() {
::buffa::encoding::Tag::new(
17u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.composer, buf);
}
if !self.performer.is_empty() {
::buffa::encoding::Tag::new(
18u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.performer, buf);
}
if !self.date.is_empty() {
::buffa::encoding::Tag::new(
19u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.date, buf);
}
if self.track_number != 0u32 {
::buffa::encoding::Tag::new(20u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.track_number, buf);
}
if self.total_tracks != 0u32 {
::buffa::encoding::Tag::new(21u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.total_tracks, buf);
}
if self.disc_number != 0u32 {
::buffa::encoding::Tag::new(22u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.disc_number, buf);
}
if self.total_discs != 0u32 {
::buffa::encoding::Tag::new(23u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.total_discs, buf);
}
if !self.comment.is_empty() {
::buffa::encoding::Tag::new(
24u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.comment, buf);
}
if !self.lyrics.is_empty() {
::buffa::encoding::Tag::new(
25u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.lyrics, buf);
}
for v in &self.tag_types {
::buffa::encoding::Tag::new(
26u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if self.cover_art.is_set() {
::buffa::encoding::Tag::new(
27u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.cover_art.write_to(__cache, buf);
}
if self.created_at != 0i64 {
::buffa::encoding::Tag::new(28u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.created_at, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.checksum = ::core::option::Option::Some(
::buffa::types::decode_bytes_to_bytes(buf)?,
);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.format = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.size = ::buffa::types::decode_uint64(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_pts = ::buffa::types::decode_int64(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed64 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 1u8,
actual: tag.wire_type() as u8,
});
}
self.frame_rate = ::buffa::types::decode_double(buf)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.bit_rate = ::buffa::types::decode_uint64(buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.time_base.get_or_insert_default(),
buf,
depth,
)?;
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.container_format = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.stream_count = ::buffa::types::decode_uint32(buf)?;
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.title = ::buffa::types::decode_string_to(buf)?;
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.artist = ::buffa::types::decode_string_to(buf)?;
}
14u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 14u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.album_artist = ::buffa::types::decode_string_to(buf)?;
}
15u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 15u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.album = ::buffa::types::decode_string_to(buf)?;
}
16u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 16u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.genre = ::buffa::types::decode_string_to(buf)?;
}
17u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 17u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.composer = ::buffa::types::decode_string_to(buf)?;
}
18u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 18u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.performer = ::buffa::types::decode_string_to(buf)?;
}
19u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 19u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.date = ::buffa::types::decode_string_to(buf)?;
}
20u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.track_number = ::buffa::types::decode_uint32(buf)?;
}
21u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 21u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_tracks = ::buffa::types::decode_uint32(buf)?;
}
22u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 22u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.disc_number = ::buffa::types::decode_uint32(buf)?;
}
23u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 23u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_discs = ::buffa::types::decode_uint32(buf)?;
}
24u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 24u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.comment = ::buffa::types::decode_string_to(buf)?;
}
25u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 25u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.lyrics = ::buffa::types::decode_string_to(buf)?;
}
26u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 26u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.tag_types.push(::buffa::types::decode_string_to(buf)?);
}
27u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 27u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.cover_art.get_or_insert_default(),
buf,
depth,
)?;
}
28u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 28u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.created_at = ::buffa::types::decode_int64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.checksum = ::core::option::Option::None;
self.name = ::core::default::Default::default();
self.format = ::buffa::EnumValue::from(0);
self.size = 0u64;
self.total_pts = 0i64;
self.frame_rate = 0f64;
self.bit_rate = 0u64;
self.time_base = ::buffa::MessageField::none();
self.container_format = ::buffa::EnumValue::from(0);
self.stream_count = 0u32;
self.title = ::core::default::Default::default();
self.artist = ::core::default::Default::default();
self.album_artist = ::core::default::Default::default();
self.album = ::core::default::Default::default();
self.genre = ::core::default::Default::default();
self.composer = ::core::default::Default::default();
self.performer = ::core::default::Default::default();
self.date = ::core::default::Default::default();
self.track_number = 0u32;
self.total_tracks = 0u32;
self.disc_number = 0u32;
self.total_discs = 0u32;
self.comment = ::core::default::Default::default();
self.lyrics = ::core::default::Default::default();
self.tag_types.clear();
self.cover_art = ::buffa::MessageField::none();
self.created_at = 0i64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for AudioFileRecord {
const PROTO_FQN: &'static str = "media.v1.AudioFileRecord";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for AudioFileRecord {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __AUDIO_FILE_RECORD_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.AudioFileRecord",
to_json: ::buffa::type_registry::any_to_json::<AudioFileRecord>,
from_json: ::buffa::type_registry::any_from_json::<AudioFileRecord>,
is_wkt: false,
};
/// ── SP3: findit `network` domain (consolidated into media.v1) ──
/// findit-proto's src/network/ Rust as a clean proto3 redesign (NO wire-compat
/// with the hand-rolled framing/encoding; correctness = round-trip + semantic
/// fidelity).
///
/// Same-package (media.v1) since the mono-consolidation; the SP3 `FailedFile` message is named `NetFailedFile` to avoid colliding with SP2's `FailedFile` DB record.
///
/// Task-0 codegen smoke fixture (NOT a domain message): proves the SP3 same-package
/// (media.v1) refs and the mediatime.v1.TimeRange extern, all resolving in a single
/// buffa codegen run. Kept permanently: it is the permanent regression guard for the
/// SP3 same-package pipeline (mirrors SP0's TimedDetection / SP2's Sp2CodegenSmoke
/// fixture role).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Sp3CodegenSmoke {
/// inline-bytes id convention (§7.1)
///
/// Field 1: `id`
#[cfg_attr(
feature = "json",
serde(
rename = "id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub id: ::buffa::bytes::Bytes,
/// same-package ref (was cross-package media.v1)
///
/// Field 2: `error`
#[cfg_attr(
feature = "json",
serde(
rename = "error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub error: ::buffa::MessageField<ErrorInfo>,
/// same-package ref (VideoMeta, SP2 DB domain)
///
/// Field 3: `video_meta`
#[cfg_attr(
feature = "json",
serde(
rename = "videoMeta",
alias = "video_meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub video_meta: ::buffa::MessageField<VideoMeta>,
/// mediatime extern (-\> ::mediatime)
///
/// Field 4: `range`
#[cfg_attr(
feature = "json",
serde(
rename = "range",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub range: ::buffa::MessageField<::mediatime::TimeRange>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Sp3CodegenSmoke {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Sp3CodegenSmoke")
.field("id", &self.id)
.field("error", &self.error)
.field("video_meta", &self.video_meta)
.field("range", &self.range)
.finish()
}
}
impl Sp3CodegenSmoke {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Sp3CodegenSmoke";
}
impl ::buffa::DefaultInstance for Sp3CodegenSmoke {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Sp3CodegenSmoke> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Sp3CodegenSmoke {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Sp3CodegenSmoke";
const FULL_NAME: &'static str = "media.v1.Sp3CodegenSmoke";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Sp3CodegenSmoke";
}
impl ::buffa::Message for Sp3CodegenSmoke {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.id) as u32;
}
if self.error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.error.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.video_meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.video_meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.range.is_set() {
let __slot = __cache.reserve();
let inner_size = self.range.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.id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.id, buf);
}
if self.error.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.error.write_to(__cache, buf);
}
if self.video_meta.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.video_meta.write_to(__cache, buf);
}
if self.range.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.range.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.error.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.video_meta.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.range.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = ::buffa::bytes::Bytes::new();
self.error = ::buffa::MessageField::none();
self.video_meta = ::buffa::MessageField::none();
self.range = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Sp3CodegenSmoke {
const PROTO_FQN: &'static str = "media.v1.Sp3CodegenSmoke";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Sp3CodegenSmoke {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SP3CODEGEN_SMOKE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Sp3CodegenSmoke",
to_json: ::buffa::type_registry::any_to_json::<Sp3CodegenSmoke>,
from_json: ::buffa::type_registry::any_from_json::<Sp3CodegenSmoke>,
is_wkt: false,
};
/// ── Batch 1: scalar leaves (§7.5 shared.rs/heartbeat.rs) ────────────────────
///
/// `limit`: client default 50 when absent (documented client-side
/// convention, NOT `optional` — the wire format carries no presence bit;
/// §7.8 #9). `offset` default 0.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Pagination {
/// Field 1: `limit`
#[cfg_attr(
feature = "json",
serde(
rename = "limit",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub limit: u32,
/// Field 2: `offset`
#[cfg_attr(
feature = "json",
serde(
rename = "offset",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub offset: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Pagination {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Pagination")
.field("limit", &self.limit)
.field("offset", &self.offset)
.finish()
}
}
impl Pagination {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Pagination";
}
impl ::buffa::DefaultInstance for Pagination {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Pagination> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Pagination {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Pagination";
const FULL_NAME: &'static str = "media.v1.Pagination";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Pagination";
}
impl ::buffa::Message for Pagination {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.limit != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.limit) as u32;
}
if self.offset != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.offset) 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.limit != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.limit, buf);
}
if self.offset != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.offset, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.limit = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.offset = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.limit = 0u32;
self.offset = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Pagination {
const PROTO_FQN: &'static str = "media.v1.Pagination";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Pagination {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __PAGINATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Pagination",
to_json: ::buffa::type_registry::any_to_json::<Pagination>,
from_json: ::buffa::type_registry::any_from_json::<Pagination>,
is_wkt: false,
};
/// `weight`: client default 1.0 when absent (documented client-side
/// convention, NOT `optional`; §7.8 #9).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SearchFilter {
/// Field 1: `key`
#[cfg_attr(
feature = "json",
serde(
rename = "key",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub key: ::buffa::smol_str::SmolStr,
/// Field 2: `value`
#[cfg_attr(
feature = "json",
serde(
rename = "value",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub value: ::buffa::smol_str::SmolStr,
/// Field 3: `weight`
#[cfg_attr(
feature = "json",
serde(
rename = "weight",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub weight: f32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SearchFilter {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SearchFilter")
.field("key", &self.key)
.field("value", &self.value)
.field("weight", &self.weight)
.finish()
}
}
impl SearchFilter {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SearchFilter";
}
impl ::buffa::DefaultInstance for SearchFilter {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SearchFilter> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SearchFilter {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SearchFilter";
const FULL_NAME: &'static str = "media.v1.SearchFilter";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SearchFilter";
}
impl ::buffa::Message for SearchFilter {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.key.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.key) as u32;
}
if !self.value.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.value) as u32;
}
if self.weight.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_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.key.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.key, buf);
}
if !self.value.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.value, buf);
}
if self.weight.to_bits() != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.weight, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.key = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.value = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.weight = ::buffa::types::decode_float(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.key = ::core::default::Default::default();
self.value = ::core::default::Default::default();
self.weight = 0f32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SearchFilter {
const PROTO_FQN: &'static str = "media.v1.SearchFilter";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SearchFilter {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SEARCH_FILTER_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SearchFilter",
to_json: ::buffa::type_registry::any_to_json::<SearchFilter>,
from_json: ::buffa::type_registry::any_from_json::<SearchFilter>,
is_wkt: false,
};
/// Unix epoch milliseconds.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct HeartbeatRequest {
/// Field 1: `timestamp`
#[cfg_attr(
feature = "json",
serde(
rename = "timestamp",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub timestamp: i64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for HeartbeatRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("HeartbeatRequest").field("timestamp", &self.timestamp).finish()
}
}
impl HeartbeatRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.HeartbeatRequest";
}
impl ::buffa::DefaultInstance for HeartbeatRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<HeartbeatRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for HeartbeatRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "HeartbeatRequest";
const FULL_NAME: &'static str = "media.v1.HeartbeatRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.HeartbeatRequest";
}
impl ::buffa::Message for HeartbeatRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.timestamp != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.timestamp) 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.timestamp != 0i64 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.timestamp, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.timestamp = ::buffa::types::decode_int64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.timestamp = 0i64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for HeartbeatRequest {
const PROTO_FQN: &'static str = "media.v1.HeartbeatRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for HeartbeatRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __HEARTBEAT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.HeartbeatRequest",
to_json: ::buffa::type_registry::any_to_json::<HeartbeatRequest>,
from_json: ::buffa::type_registry::any_from_json::<HeartbeatRequest>,
is_wkt: false,
};
/// Unix epoch milliseconds.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct HeartbeatResponse {
/// Field 1: `timestamp`
#[cfg_attr(
feature = "json",
serde(
rename = "timestamp",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub timestamp: i64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for HeartbeatResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("HeartbeatResponse").field("timestamp", &self.timestamp).finish()
}
}
impl HeartbeatResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.HeartbeatResponse";
}
impl ::buffa::DefaultInstance for HeartbeatResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<HeartbeatResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for HeartbeatResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "HeartbeatResponse";
const FULL_NAME: &'static str = "media.v1.HeartbeatResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.HeartbeatResponse";
}
impl ::buffa::Message for HeartbeatResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.timestamp != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.timestamp) 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.timestamp != 0i64 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.timestamp, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.timestamp = ::buffa::types::decode_int64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.timestamp = 0i64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for HeartbeatResponse {
const PROTO_FQN: &'static str = "media.v1.HeartbeatResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for HeartbeatResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __HEARTBEAT_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.HeartbeatResponse",
to_json: ::buffa::type_registry::any_to_json::<HeartbeatResponse>,
from_json: ::buffa::type_registry::any_from_json::<HeartbeatResponse>,
is_wkt: false,
};
/// ── Batch 2: reuse-only leaves (§7.5 shared.rs) ─────────────────────────────
///
/// `scene_id`/`video_id`: inline bytes (Id convention, §7.1). `range`:
/// mediatime.v1.TimeRange extern (-\> ::mediatime). `dimensions`:
/// Dimensions (SP1 split uint32 width/height; source packed u32
/// via to_u32() — clean-redesign, §7.8 #8).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SearchHit {
/// Field 1: `scene_id`
#[cfg_attr(
feature = "json",
serde(
rename = "sceneId",
alias = "scene_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub scene_id: ::buffa::bytes::Bytes,
/// Field 2: `video_id`
#[cfg_attr(
feature = "json",
serde(
rename = "videoId",
alias = "video_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub video_id: ::buffa::bytes::Bytes,
/// Field 3: `video_name`
#[cfg_attr(
feature = "json",
serde(
rename = "videoName",
alias = "video_name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub video_name: ::buffa::smol_str::SmolStr,
/// Field 4: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
/// Field 5: `description`
#[cfg_attr(
feature = "json",
serde(
rename = "description",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub description: ::buffa::smol_str::SmolStr,
/// Field 6: `score`
#[cfg_attr(
feature = "json",
serde(
rename = "score",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub score: f32,
/// Field 7: `range`
#[cfg_attr(
feature = "json",
serde(
rename = "range",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub range: ::buffa::MessageField<::mediatime::TimeRange>,
/// Field 8: `thumbnail`
#[cfg_attr(
feature = "json",
serde(
rename = "thumbnail",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub thumbnail: ::buffa::bytes::Bytes,
/// Field 9: `dimensions`
#[cfg_attr(
feature = "json",
serde(
rename = "dimensions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub dimensions: ::buffa::MessageField<Dimensions>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SearchHit {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SearchHit")
.field("scene_id", &self.scene_id)
.field("video_id", &self.video_id)
.field("video_name", &self.video_name)
.field("location", &self.location)
.field("description", &self.description)
.field("score", &self.score)
.field("range", &self.range)
.field("thumbnail", &self.thumbnail)
.field("dimensions", &self.dimensions)
.finish()
}
}
impl SearchHit {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SearchHit";
}
impl ::buffa::DefaultInstance for SearchHit {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SearchHit> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SearchHit {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SearchHit";
const FULL_NAME: &'static str = "media.v1.SearchHit";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SearchHit";
}
impl ::buffa::Message for SearchHit {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.scene_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.scene_id) as u32;
}
if !self.video_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.video_id) as u32;
}
if !self.video_name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.video_name) as u32;
}
if self.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.description.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.description) as u32;
}
if self.score.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.range.is_set() {
let __slot = __cache.reserve();
let inner_size = self.range.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.thumbnail.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.thumbnail) as u32;
}
if self.dimensions.is_set() {
let __slot = __cache.reserve();
let inner_size = self.dimensions.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.scene_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.scene_id, buf);
}
if !self.video_id.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.video_id, buf);
}
if !self.video_name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.video_name, buf);
}
if self.location.is_set() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.write_to(__cache, buf);
}
if !self.description.is_empty() {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.description, buf);
}
if self.score.to_bits() != 0u32 {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.score, buf);
}
if self.range.is_set() {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.range.write_to(__cache, buf);
}
if !self.thumbnail.is_empty() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.thumbnail, buf);
}
if self.dimensions.is_set() {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.dimensions.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.scene_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.video_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.video_name = ::buffa::types::decode_string_to(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.description = ::buffa::types::decode_string_to(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.score = ::buffa::types::decode_float(buf)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.range.get_or_insert_default(),
buf,
depth,
)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.thumbnail = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.dimensions.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.scene_id = ::buffa::bytes::Bytes::new();
self.video_id = ::buffa::bytes::Bytes::new();
self.video_name = ::core::default::Default::default();
self.location = ::buffa::MessageField::none();
self.description = ::core::default::Default::default();
self.score = 0f32;
self.range = ::buffa::MessageField::none();
self.thumbnail = ::buffa::bytes::Bytes::new();
self.dimensions = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SearchHit {
const PROTO_FQN: &'static str = "media.v1.SearchHit";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SearchHit {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SEARCH_HIT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SearchHit",
to_json: ::buffa::type_registry::any_to_json::<SearchHit>,
from_json: ::buffa::type_registry::any_from_json::<SearchHit>,
is_wkt: false,
};
/// `meta`: VideoMeta (SP2 DB domain, same-package). `scene_count`
/// src u16 varint -\> uint32. `thumbnail`: inline bytes.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct BrowseItem {
/// Field 1: `meta`
#[cfg_attr(
feature = "json",
serde(
rename = "meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub meta: ::buffa::MessageField<VideoMeta>,
/// Field 2: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
/// Field 3: `scene_count`
#[cfg_attr(
feature = "json",
serde(
rename = "sceneCount",
alias = "scene_count",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub scene_count: u32,
/// Field 4: `thumbnail`
#[cfg_attr(
feature = "json",
serde(
rename = "thumbnail",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub thumbnail: ::buffa::bytes::Bytes,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BrowseItem {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BrowseItem")
.field("meta", &self.meta)
.field("location", &self.location)
.field("scene_count", &self.scene_count)
.field("thumbnail", &self.thumbnail)
.finish()
}
}
impl BrowseItem {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BrowseItem";
}
impl ::buffa::DefaultInstance for BrowseItem {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<BrowseItem> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for BrowseItem {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "BrowseItem";
const FULL_NAME: &'static str = "media.v1.BrowseItem";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BrowseItem";
}
impl ::buffa::Message for BrowseItem {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.scene_count != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.scene_count) as u32;
}
if !self.thumbnail.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.thumbnail) 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.meta.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.meta.write_to(__cache, buf);
}
if self.location.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.write_to(__cache, buf);
}
if self.scene_count != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.scene_count, buf);
}
if !self.thumbnail.is_empty() {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.thumbnail, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.meta.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.scene_count = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.thumbnail = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.meta = ::buffa::MessageField::none();
self.location = ::buffa::MessageField::none();
self.scene_count = 0u32;
self.thumbnail = ::buffa::bytes::Bytes::new();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BrowseItem {
const PROTO_FQN: &'static str = "media.v1.BrowseItem";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for BrowseItem {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __BROWSE_ITEM_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.BrowseItem",
to_json: ::buffa::type_registry::any_to_json::<BrowseItem>,
from_json: ::buffa::type_registry::any_from_json::<BrowseItem>,
is_wkt: false,
};
/// `status`: bare u32 enum-by-convention (NOT a proto enum, §7.3) —
/// 0=not_downloaded, 1=downloading, 2=ready, 3=error. Values outside this
/// set round-trip exactly (the migration's correctness criterion).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ModelInfo {
/// Field 1: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 2: `status`
#[cfg_attr(
feature = "json",
serde(
rename = "status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub status: u32,
/// Field 3: `size_bytes`
#[cfg_attr(
feature = "json",
serde(
rename = "sizeBytes",
alias = "size_bytes",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub size_bytes: u64,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ModelInfo {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ModelInfo")
.field("name", &self.name)
.field("status", &self.status)
.field("size_bytes", &self.size_bytes)
.finish()
}
}
impl ModelInfo {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ModelInfo";
}
impl ::buffa::DefaultInstance for ModelInfo {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ModelInfo> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ModelInfo {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ModelInfo";
const FULL_NAME: &'static str = "media.v1.ModelInfo";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ModelInfo";
}
impl ::buffa::Message for ModelInfo {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.status) as u32;
}
if self.size_bytes != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.size_bytes) 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::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.status != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.status, buf);
}
if self.size_bytes != 0u64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.size_bytes, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.status = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.size_bytes = ::buffa::types::decode_uint64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::default::Default::default();
self.status = 0u32;
self.size_bytes = 0u64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ModelInfo {
const PROTO_FQN: &'static str = "media.v1.ModelInfo";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ModelInfo {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __MODEL_INFO_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ModelInfo",
to_json: ::buffa::type_registry::any_to_json::<ModelInfo>,
from_json: ::buffa::type_registry::any_from_json::<ModelInfo>,
is_wkt: false,
};
/// `status`: bare u32 enum-by-convention (NOT a proto enum, §7.3) —
/// 0=pending, 1=downloading, 2=paused, 3=completed, 4=error (distinct
/// value set from ModelInfo.status; documentary only). `progress` 0.0–1.0.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ModelDownloadProgress {
/// Field 1: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 2: `progress`
#[cfg_attr(
feature = "json",
serde(
rename = "progress",
with = "::buffa::json_helpers::float",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_f32"
)
)]
pub progress: f32,
/// Field 3: `downloaded_bytes`
#[cfg_attr(
feature = "json",
serde(
rename = "downloadedBytes",
alias = "downloaded_bytes",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub downloaded_bytes: u64,
/// Field 4: `total_bytes`
#[cfg_attr(
feature = "json",
serde(
rename = "totalBytes",
alias = "total_bytes",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_bytes: u64,
/// Field 5: `status`
#[cfg_attr(
feature = "json",
serde(
rename = "status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub status: u32,
/// Field 6: `error_msg`
#[cfg_attr(
feature = "json",
serde(
rename = "errorMsg",
alias = "error_msg",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub error_msg: ::buffa::smol_str::SmolStr,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ModelDownloadProgress {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ModelDownloadProgress")
.field("name", &self.name)
.field("progress", &self.progress)
.field("downloaded_bytes", &self.downloaded_bytes)
.field("total_bytes", &self.total_bytes)
.field("status", &self.status)
.field("error_msg", &self.error_msg)
.finish()
}
}
impl ModelDownloadProgress {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ModelDownloadProgress";
}
impl ::buffa::DefaultInstance for ModelDownloadProgress {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ModelDownloadProgress> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ModelDownloadProgress {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ModelDownloadProgress";
const FULL_NAME: &'static str = "media.v1.ModelDownloadProgress";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ModelDownloadProgress";
}
impl ::buffa::Message for ModelDownloadProgress {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.progress.to_bits() != 0u32 {
size += 1u32 + ::buffa::types::FIXED32_ENCODED_LEN as u32;
}
if self.downloaded_bytes != 0u64 {
size
+= 1u32
+ ::buffa::types::uint64_encoded_len(self.downloaded_bytes) as u32;
}
if self.total_bytes != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_bytes) as u32;
}
if self.status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.status) as u32;
}
if !self.error_msg.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.error_msg) 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::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.progress.to_bits() != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Fixed32)
.encode(buf);
::buffa::types::encode_float(self.progress, buf);
}
if self.downloaded_bytes != 0u64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.downloaded_bytes, buf);
}
if self.total_bytes != 0u64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_bytes, buf);
}
if self.status != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.status, buf);
}
if !self.error_msg.is_empty() {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.error_msg, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Fixed32 {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 5u8,
actual: tag.wire_type() as u8,
});
}
self.progress = ::buffa::types::decode_float(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.downloaded_bytes = ::buffa::types::decode_uint64(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_bytes = ::buffa::types::decode_uint64(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.status = ::buffa::types::decode_uint32(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.error_msg = ::buffa::types::decode_string_to(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name = ::core::default::Default::default();
self.progress = 0f32;
self.downloaded_bytes = 0u64;
self.total_bytes = 0u64;
self.status = 0u32;
self.error_msg = ::core::default::Default::default();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ModelDownloadProgress {
const PROTO_FQN: &'static str = "media.v1.ModelDownloadProgress";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ModelDownloadProgress {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __MODEL_DOWNLOAD_PROGRESS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ModelDownloadProgress",
to_json: ::buffa::type_registry::any_to_json::<ModelDownloadProgress>,
from_json: ::buffa::type_registry::any_from_json::<ModelDownloadProgress>,
is_wkt: false,
};
/// `kind`: bare u32 enum-by-convention (NOT a proto enum, §7.3) — 0=video,
/// 1=audio. `error_status`/`index_status`: inline uint32 VideoIndexStatus
/// (SP2 bitflag reused by-value, §7.4) — bits: PROBED=0x01,
/// SCENE_DETECTED=0x02, KEYFRAME_EXTRACTED=0x04, VLM_ANALYZED=0x10,
/// APPLE_VISION_ANALYZED=0x20, TEXT_EMBEDDING_FINISHED=0x40,
/// SCENE_EMBEDDING_FINISHED=0x80 (source gap at 0x08). DISTINCT type from
/// NetFailedFile (the distinct package disambiguates, §7.1).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct NetFailedFile {
/// Field 1: `kind`
#[cfg_attr(
feature = "json",
serde(
rename = "kind",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub kind: u32,
/// Field 2: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
/// Field 3: `error`
#[cfg_attr(
feature = "json",
serde(
rename = "error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub error: ::buffa::MessageField<ErrorInfo>,
/// Field 4: `error_status`
#[cfg_attr(
feature = "json",
serde(
rename = "errorStatus",
alias = "error_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub error_status: u32,
/// Field 5: `index_status`
#[cfg_attr(
feature = "json",
serde(
rename = "indexStatus",
alias = "index_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub index_status: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for NetFailedFile {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("NetFailedFile")
.field("kind", &self.kind)
.field("location", &self.location)
.field("error", &self.error)
.field("error_status", &self.error_status)
.field("index_status", &self.index_status)
.finish()
}
}
impl NetFailedFile {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.NetFailedFile";
}
impl ::buffa::DefaultInstance for NetFailedFile {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<NetFailedFile> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for NetFailedFile {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "NetFailedFile";
const FULL_NAME: &'static str = "media.v1.NetFailedFile";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.NetFailedFile";
}
impl ::buffa::Message for NetFailedFile {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.kind != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.kind) as u32;
}
if self.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.error.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.error_status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.error_status) as u32;
}
if self.index_status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.index_status) 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.kind != 0u32 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.kind, buf);
}
if self.location.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.write_to(__cache, buf);
}
if self.error.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.error.write_to(__cache, buf);
}
if self.error_status != 0u32 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.error_status, buf);
}
if self.index_status != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.index_status, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.kind = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.error.get_or_insert_default(),
buf,
depth,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.error_status = ::buffa::types::decode_uint32(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.index_status = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.kind = 0u32;
self.location = ::buffa::MessageField::none();
self.error = ::buffa::MessageField::none();
self.error_status = 0u32;
self.index_status = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for NetFailedFile {
const PROTO_FQN: &'static str = "media.v1.NetFailedFile";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for NetFailedFile {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __NET_FAILED_FILE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.NetFailedFile",
to_json: ::buffa::type_registry::any_to_json::<NetFailedFile>,
from_json: ::buffa::type_registry::any_from_json::<NetFailedFile>,
is_wkt: false,
};
/// `completed_phases`: inline uint32 VideoIndexStatus (SP2 bitflag reused
/// by-value, §7.4) — bits: PROBED=0x01, SCENE_DETECTED=0x02,
/// KEYFRAME_EXTRACTED=0x04, VLM_ANALYZED=0x10, APPLE_VISION_ANALYZED=0x20,
/// TEXT_EMBEDDING_FINISHED=0x40, SCENE_EMBEDDING_FINISHED=0x80 (src gap
/// at 0x08).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct IndexingFile {
/// Field 1: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
/// Field 2: `name`
#[cfg_attr(
feature = "json",
serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub name: ::buffa::smol_str::SmolStr,
/// Field 3: `completed_phases`
#[cfg_attr(
feature = "json",
serde(
rename = "completedPhases",
alias = "completed_phases",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub completed_phases: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for IndexingFile {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("IndexingFile")
.field("location", &self.location)
.field("name", &self.name)
.field("completed_phases", &self.completed_phases)
.finish()
}
}
impl IndexingFile {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.IndexingFile";
}
impl ::buffa::DefaultInstance for IndexingFile {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<IndexingFile> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for IndexingFile {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "IndexingFile";
const FULL_NAME: &'static str = "media.v1.IndexingFile";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.IndexingFile";
}
impl ::buffa::Message for IndexingFile {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if self.completed_phases != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.completed_phases) 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.location.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.write_to(__cache, buf);
}
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if self.completed_phases != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.completed_phases, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.name = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.completed_phases = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.location = ::buffa::MessageField::none();
self.name = ::core::default::Default::default();
self.completed_phases = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for IndexingFile {
const PROTO_FQN: &'static str = "media.v1.IndexingFile";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for IndexingFile {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __INDEXING_FILE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.IndexingFile",
to_json: ::buffa::type_registry::any_to_json::<IndexingFile>,
from_json: ::buffa::type_registry::any_from_json::<IndexingFile>,
is_wkt: false,
};
/// ── Batch 3: empty + simple request/response leaves (§7.5 folder.rs/
/// ```text
/// volume_eject.rs/file.rs/daemon.rs/model.rs/search.rs/browse.rs/annotation.rs) ────
/// ```
///
/// Empty request (zero fields) — the discriminant alone carries intent.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ListLocationsRequest {
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ListLocationsRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ListLocationsRequest").finish()
}
}
impl ListLocationsRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ListLocationsRequest";
}
impl ::buffa::DefaultInstance for ListLocationsRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ListLocationsRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ListLocationsRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ListLocationsRequest";
const FULL_NAME: &'static str = "media.v1.ListLocationsRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ListLocationsRequest";
}
impl ::buffa::Message for ListLocationsRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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;
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 _;
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ListLocationsRequest {
const PROTO_FQN: &'static str = "media.v1.ListLocationsRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ListLocationsRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LIST_LOCATIONS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ListLocationsRequest",
to_json: ::buffa::type_registry::any_to_json::<ListLocationsRequest>,
from_json: ::buffa::type_registry::any_from_json::<ListLocationsRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct RemoveLocationResponse {
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for RemoveLocationResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("RemoveLocationResponse").finish()
}
}
impl RemoveLocationResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.RemoveLocationResponse";
}
impl ::buffa::DefaultInstance for RemoveLocationResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<RemoveLocationResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for RemoveLocationResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "RemoveLocationResponse";
const FULL_NAME: &'static str = "media.v1.RemoveLocationResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.RemoveLocationResponse";
}
impl ::buffa::Message for RemoveLocationResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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;
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 _;
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for RemoveLocationResponse {
const PROTO_FQN: &'static str = "media.v1.RemoveLocationResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for RemoveLocationResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __REMOVE_LOCATION_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.RemoveLocationResponse",
to_json: ::buffa::type_registry::any_to_json::<RemoveLocationResponse>,
from_json: ::buffa::type_registry::any_from_json::<RemoveLocationResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct RetryFailedResponse {
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for RetryFailedResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("RetryFailedResponse").finish()
}
}
impl RetryFailedResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.RetryFailedResponse";
}
impl ::buffa::DefaultInstance for RetryFailedResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<RetryFailedResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for RetryFailedResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "RetryFailedResponse";
const FULL_NAME: &'static str = "media.v1.RetryFailedResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.RetryFailedResponse";
}
impl ::buffa::Message for RetryFailedResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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;
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 _;
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for RetryFailedResponse {
const PROTO_FQN: &'static str = "media.v1.RetryFailedResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for RetryFailedResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __RETRY_FAILED_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.RetryFailedResponse",
to_json: ::buffa::type_registry::any_to_json::<RetryFailedResponse>,
from_json: ::buffa::type_registry::any_from_json::<RetryFailedResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct EjectVolumeResponse {
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for EjectVolumeResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("EjectVolumeResponse").finish()
}
}
impl EjectVolumeResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.EjectVolumeResponse";
}
impl ::buffa::DefaultInstance for EjectVolumeResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<EjectVolumeResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for EjectVolumeResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "EjectVolumeResponse";
const FULL_NAME: &'static str = "media.v1.EjectVolumeResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.EjectVolumeResponse";
}
impl ::buffa::Message for EjectVolumeResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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;
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 _;
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for EjectVolumeResponse {
const PROTO_FQN: &'static str = "media.v1.EjectVolumeResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for EjectVolumeResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __EJECT_VOLUME_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.EjectVolumeResponse",
to_json: ::buffa::type_registry::any_to_json::<EjectVolumeResponse>,
from_json: ::buffa::type_registry::any_from_json::<EjectVolumeResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct GetModelStatusRequest {
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetModelStatusRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetModelStatusRequest").finish()
}
}
impl GetModelStatusRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetModelStatusRequest";
}
impl ::buffa::DefaultInstance for GetModelStatusRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetModelStatusRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetModelStatusRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "GetModelStatusRequest";
const FULL_NAME: &'static str = "media.v1.GetModelStatusRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetModelStatusRequest";
}
impl ::buffa::Message for GetModelStatusRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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;
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 _;
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetModelStatusRequest {
const PROTO_FQN: &'static str = "media.v1.GetModelStatusRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for GetModelStatusRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __GET_MODEL_STATUS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.GetModelStatusRequest",
to_json: ::buffa::type_registry::any_to_json::<GetModelStatusRequest>,
from_json: ::buffa::type_registry::any_from_json::<GetModelStatusRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct GetDaemonInfoRequest {
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetDaemonInfoRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetDaemonInfoRequest").finish()
}
}
impl GetDaemonInfoRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetDaemonInfoRequest";
}
impl ::buffa::DefaultInstance for GetDaemonInfoRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetDaemonInfoRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetDaemonInfoRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "GetDaemonInfoRequest";
const FULL_NAME: &'static str = "media.v1.GetDaemonInfoRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetDaemonInfoRequest";
}
impl ::buffa::Message for GetDaemonInfoRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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;
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 _;
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetDaemonInfoRequest {
const PROTO_FQN: &'static str = "media.v1.GetDaemonInfoRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for GetDaemonInfoRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __GET_DAEMON_INFO_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.GetDaemonInfoRequest",
to_json: ::buffa::type_registry::any_to_json::<GetDaemonInfoRequest>,
from_json: ::buffa::type_registry::any_from_json::<GetDaemonInfoRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct UpdateAnnotationResponse {
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for UpdateAnnotationResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("UpdateAnnotationResponse").finish()
}
}
impl UpdateAnnotationResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.UpdateAnnotationResponse";
}
impl ::buffa::DefaultInstance for UpdateAnnotationResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<UpdateAnnotationResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for UpdateAnnotationResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "UpdateAnnotationResponse";
const FULL_NAME: &'static str = "media.v1.UpdateAnnotationResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.UpdateAnnotationResponse";
}
impl ::buffa::Message for UpdateAnnotationResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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;
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 _;
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for UpdateAnnotationResponse {
const PROTO_FQN: &'static str = "media.v1.UpdateAnnotationResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for UpdateAnnotationResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __UPDATE_ANNOTATION_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.UpdateAnnotationResponse",
to_json: ::buffa::type_registry::any_to_json::<UpdateAnnotationResponse>,
from_json: ::buffa::type_registry::any_from_json::<UpdateAnnotationResponse>,
is_wkt: false,
};
/// `volume_id`: inline bytes (Id convention, §7.1).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct EjectVolumeRequest {
/// Field 1: `volume_id`
#[cfg_attr(
feature = "json",
serde(
rename = "volumeId",
alias = "volume_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub volume_id: ::buffa::bytes::Bytes,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for EjectVolumeRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("EjectVolumeRequest").field("volume_id", &self.volume_id).finish()
}
}
impl EjectVolumeRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.EjectVolumeRequest";
}
impl ::buffa::DefaultInstance for EjectVolumeRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<EjectVolumeRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for EjectVolumeRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "EjectVolumeRequest";
const FULL_NAME: &'static str = "media.v1.EjectVolumeRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.EjectVolumeRequest";
}
impl ::buffa::Message for EjectVolumeRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.volume_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.volume_id) 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.volume_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.volume_id, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.volume_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.volume_id = ::buffa::bytes::Bytes::new();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for EjectVolumeRequest {
const PROTO_FQN: &'static str = "media.v1.EjectVolumeRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for EjectVolumeRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __EJECT_VOLUME_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.EjectVolumeRequest",
to_json: ::buffa::type_registry::any_to_json::<EjectVolumeRequest>,
from_json: ::buffa::type_registry::any_from_json::<EjectVolumeRequest>,
is_wkt: false,
};
/// `checksum`: inline bytes (FileChecksum convention, §7.1).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct GetIndexedFileRequest {
/// Field 1: `checksum`
#[cfg_attr(
feature = "json",
serde(
rename = "checksum",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub checksum: ::buffa::bytes::Bytes,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetIndexedFileRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetIndexedFileRequest")
.field("checksum", &self.checksum)
.finish()
}
}
impl GetIndexedFileRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetIndexedFileRequest";
}
impl ::buffa::DefaultInstance for GetIndexedFileRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetIndexedFileRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetIndexedFileRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "GetIndexedFileRequest";
const FULL_NAME: &'static str = "media.v1.GetIndexedFileRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetIndexedFileRequest";
}
impl ::buffa::Message for GetIndexedFileRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.checksum.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.checksum) 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.checksum.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.checksum, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.checksum = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.checksum = ::buffa::bytes::Bytes::new();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetIndexedFileRequest {
const PROTO_FQN: &'static str = "media.v1.GetIndexedFileRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for GetIndexedFileRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __GET_INDEXED_FILE_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.GetIndexedFileRequest",
to_json: ::buffa::type_registry::any_to_json::<GetIndexedFileRequest>,
from_json: ::buffa::type_registry::any_from_json::<GetIndexedFileRequest>,
is_wkt: false,
};
/// `video_id`: inline bytes (Id convention, §7.1).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct GetFileIndexingStatsRequest {
/// Field 1: `video_id`
#[cfg_attr(
feature = "json",
serde(
rename = "videoId",
alias = "video_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub video_id: ::buffa::bytes::Bytes,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetFileIndexingStatsRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetFileIndexingStatsRequest")
.field("video_id", &self.video_id)
.finish()
}
}
impl GetFileIndexingStatsRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetFileIndexingStatsRequest";
}
impl ::buffa::DefaultInstance for GetFileIndexingStatsRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetFileIndexingStatsRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetFileIndexingStatsRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "GetFileIndexingStatsRequest";
const FULL_NAME: &'static str = "media.v1.GetFileIndexingStatsRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetFileIndexingStatsRequest";
}
impl ::buffa::Message for GetFileIndexingStatsRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.video_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.video_id) 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.video_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.video_id, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.video_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.video_id = ::buffa::bytes::Bytes::new();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetFileIndexingStatsRequest {
const PROTO_FQN: &'static str = "media.v1.GetFileIndexingStatsRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for GetFileIndexingStatsRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __GET_FILE_INDEXING_STATS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.GetFileIndexingStatsRequest",
to_json: ::buffa::type_registry::any_to_json::<GetFileIndexingStatsRequest>,
from_json: ::buffa::type_registry::any_from_json::<GetFileIndexingStatsRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct GetLocationStatsRequest {
/// Field 1: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetLocationStatsRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetLocationStatsRequest")
.field("location", &self.location)
.finish()
}
}
impl GetLocationStatsRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetLocationStatsRequest";
}
impl ::buffa::DefaultInstance for GetLocationStatsRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetLocationStatsRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetLocationStatsRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "GetLocationStatsRequest";
const FULL_NAME: &'static str = "media.v1.GetLocationStatsRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetLocationStatsRequest";
}
impl ::buffa::Message for GetLocationStatsRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.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.location.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.location = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetLocationStatsRequest {
const PROTO_FQN: &'static str = "media.v1.GetLocationStatsRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for GetLocationStatsRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __GET_LOCATION_STATS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.GetLocationStatsRequest",
to_json: ::buffa::type_registry::any_to_json::<GetLocationStatsRequest>,
from_json: ::buffa::type_registry::any_from_json::<GetLocationStatsRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct RemoveLocationRequest {
/// Field 1: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for RemoveLocationRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("RemoveLocationRequest")
.field("location", &self.location)
.finish()
}
}
impl RemoveLocationRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.RemoveLocationRequest";
}
impl ::buffa::DefaultInstance for RemoveLocationRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<RemoveLocationRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for RemoveLocationRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "RemoveLocationRequest";
const FULL_NAME: &'static str = "media.v1.RemoveLocationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.RemoveLocationRequest";
}
impl ::buffa::Message for RemoveLocationRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.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.location.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.location = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for RemoveLocationRequest {
const PROTO_FQN: &'static str = "media.v1.RemoveLocationRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for RemoveLocationRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __REMOVE_LOCATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.RemoveLocationRequest",
to_json: ::buffa::type_registry::any_to_json::<RemoveLocationRequest>,
from_json: ::buffa::type_registry::any_from_json::<RemoveLocationRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct RetryFailedRequest {
/// Field 1: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for RetryFailedRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("RetryFailedRequest").field("location", &self.location).finish()
}
}
impl RetryFailedRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.RetryFailedRequest";
}
impl ::buffa::DefaultInstance for RetryFailedRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<RetryFailedRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for RetryFailedRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "RetryFailedRequest";
const FULL_NAME: &'static str = "media.v1.RetryFailedRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.RetryFailedRequest";
}
impl ::buffa::Message for RetryFailedRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.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.location.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.location = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for RetryFailedRequest {
const PROTO_FQN: &'static str = "media.v1.RetryFailedRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for RetryFailedRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __RETRY_FAILED_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.RetryFailedRequest",
to_json: ::buffa::type_registry::any_to_json::<RetryFailedRequest>,
from_json: ::buffa::type_registry::any_from_json::<RetryFailedRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct BrowseRequest {
/// Field 1: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
/// Field 2: `pagination`
#[cfg_attr(
feature = "json",
serde(
rename = "pagination",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub pagination: ::buffa::MessageField<Pagination>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BrowseRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BrowseRequest")
.field("location", &self.location)
.field("pagination", &self.pagination)
.finish()
}
}
impl BrowseRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BrowseRequest";
}
impl ::buffa::DefaultInstance for BrowseRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<BrowseRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for BrowseRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "BrowseRequest";
const FULL_NAME: &'static str = "media.v1.BrowseRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BrowseRequest";
}
impl ::buffa::Message for BrowseRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.pagination.is_set() {
let __slot = __cache.reserve();
let inner_size = self.pagination.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.location.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.write_to(__cache, buf);
}
if self.pagination.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.pagination.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.pagination.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.location = ::buffa::MessageField::none();
self.pagination = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BrowseRequest {
const PROTO_FQN: &'static str = "media.v1.BrowseRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for BrowseRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __BROWSE_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.BrowseRequest",
to_json: ::buffa::type_registry::any_to_json::<BrowseRequest>,
from_json: ::buffa::type_registry::any_from_json::<BrowseRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct IndexLocationRequest {
/// Field 1: `target`
#[cfg_attr(
feature = "json",
serde(
rename = "target",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub target: ::buffa::MessageField<LocationTarget>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for IndexLocationRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("IndexLocationRequest").field("target", &self.target).finish()
}
}
impl IndexLocationRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.IndexLocationRequest";
}
impl ::buffa::DefaultInstance for IndexLocationRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<IndexLocationRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for IndexLocationRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "IndexLocationRequest";
const FULL_NAME: &'static str = "media.v1.IndexLocationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.IndexLocationRequest";
}
impl ::buffa::Message for IndexLocationRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.target.is_set() {
let __slot = __cache.reserve();
let inner_size = self.target.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.target.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.target.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.target.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.target = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for IndexLocationRequest {
const PROTO_FQN: &'static str = "media.v1.IndexLocationRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for IndexLocationRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __INDEX_LOCATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.IndexLocationRequest",
to_json: ::buffa::type_registry::any_to_json::<IndexLocationRequest>,
from_json: ::buffa::type_registry::any_from_json::<IndexLocationRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct IndexLocationResponse {
/// Field 1: `folder`
#[cfg_attr(
feature = "json",
serde(
rename = "folder",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub folder: ::buffa::MessageField<WatchedLocation>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for IndexLocationResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("IndexLocationResponse").field("folder", &self.folder).finish()
}
}
impl IndexLocationResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.IndexLocationResponse";
}
impl ::buffa::DefaultInstance for IndexLocationResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<IndexLocationResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for IndexLocationResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "IndexLocationResponse";
const FULL_NAME: &'static str = "media.v1.IndexLocationResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.IndexLocationResponse";
}
impl ::buffa::Message for IndexLocationResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.folder.is_set() {
let __slot = __cache.reserve();
let inner_size = self.folder.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.folder.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.folder.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.folder.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.folder = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for IndexLocationResponse {
const PROTO_FQN: &'static str = "media.v1.IndexLocationResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for IndexLocationResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __INDEX_LOCATION_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.IndexLocationResponse",
to_json: ::buffa::type_registry::any_to_json::<IndexLocationResponse>,
from_json: ::buffa::type_registry::any_from_json::<IndexLocationResponse>,
is_wkt: false,
};
/// `scene_ids`: repeated bytes (Id convention, §7.1). `user_tags`:
/// Tag (SP1, same-package).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct UpdateAnnotationRequest {
/// Field 1: `scene_ids`
#[cfg_attr(
feature = "json",
serde(
rename = "sceneIds",
alias = "scene_ids",
with = "::buffa::json_helpers::proto_seq",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes_vec)
)]
pub scene_ids: ::buffa::alloc::vec::Vec<::buffa::bytes::Bytes>,
/// Field 2: `user_tags`
#[cfg_attr(
feature = "json",
serde(
rename = "userTags",
alias = "user_tags",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub user_tags: ::buffa::alloc::vec::Vec<Tag>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for UpdateAnnotationRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("UpdateAnnotationRequest")
.field("scene_ids", &self.scene_ids)
.field("user_tags", &self.user_tags)
.finish()
}
}
impl UpdateAnnotationRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.UpdateAnnotationRequest";
}
impl ::buffa::DefaultInstance for UpdateAnnotationRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<UpdateAnnotationRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for UpdateAnnotationRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "UpdateAnnotationRequest";
const FULL_NAME: &'static str = "media.v1.UpdateAnnotationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.UpdateAnnotationRequest";
}
impl ::buffa::Message for UpdateAnnotationRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.scene_ids {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
for v in &self.user_tags {
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.scene_ids {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(v, buf);
}
for v in &self.user_tags {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.scene_ids.push(::buffa::types::decode_bytes_to_bytes(buf)?);
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.user_tags.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.scene_ids.clear();
self.user_tags.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for UpdateAnnotationRequest {
const PROTO_FQN: &'static str = "media.v1.UpdateAnnotationRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for UpdateAnnotationRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __UPDATE_ANNOTATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.UpdateAnnotationRequest",
to_json: ::buffa::type_registry::any_to_json::<UpdateAnnotationRequest>,
from_json: ::buffa::type_registry::any_from_json::<UpdateAnnotationRequest>,
is_wkt: false,
};
/// `search_id`: inline bytes (Id convention, §7.1).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SearchResponse {
/// Field 1: `search_id`
#[cfg_attr(
feature = "json",
serde(
rename = "searchId",
alias = "search_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub search_id: ::buffa::bytes::Bytes,
/// Field 2: `total_count`
#[cfg_attr(
feature = "json",
serde(
rename = "totalCount",
alias = "total_count",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub total_count: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SearchResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SearchResponse")
.field("search_id", &self.search_id)
.field("total_count", &self.total_count)
.finish()
}
}
impl SearchResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SearchResponse";
}
impl ::buffa::DefaultInstance for SearchResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SearchResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SearchResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SearchResponse";
const FULL_NAME: &'static str = "media.v1.SearchResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SearchResponse";
}
impl ::buffa::Message for SearchResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.search_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.search_id) as u32;
}
if self.total_count != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.total_count) 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.search_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.search_id, buf);
}
if self.total_count != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.total_count, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.search_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_count = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.search_id = ::buffa::bytes::Bytes::new();
self.total_count = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SearchResponse {
const PROTO_FQN: &'static str = "media.v1.SearchResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SearchResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SEARCH_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SearchResponse",
to_json: ::buffa::type_registry::any_to_json::<SearchResponse>,
from_json: ::buffa::type_registry::any_from_json::<SearchResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct GetDaemonInfoResponse {
/// Field 1: `version`
#[cfg_attr(
feature = "json",
serde(
rename = "version",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub version: ::buffa::smol_str::SmolStr,
/// Field 2: `started_at`
#[cfg_attr(
feature = "json",
serde(
rename = "startedAt",
alias = "started_at",
with = "::buffa::json_helpers::int64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
)
)]
pub started_at: i64,
/// Field 3: `total_videos`
#[cfg_attr(
feature = "json",
serde(
rename = "totalVideos",
alias = "total_videos",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_videos: u64,
/// Field 4: `total_scenes`
#[cfg_attr(
feature = "json",
serde(
rename = "totalScenes",
alias = "total_scenes",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_scenes: u64,
/// Field 5: `active_tasks`
#[cfg_attr(
feature = "json",
serde(
rename = "activeTasks",
alias = "active_tasks",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub active_tasks: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetDaemonInfoResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetDaemonInfoResponse")
.field("version", &self.version)
.field("started_at", &self.started_at)
.field("total_videos", &self.total_videos)
.field("total_scenes", &self.total_scenes)
.field("active_tasks", &self.active_tasks)
.finish()
}
}
impl GetDaemonInfoResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetDaemonInfoResponse";
}
impl ::buffa::DefaultInstance for GetDaemonInfoResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetDaemonInfoResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetDaemonInfoResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "GetDaemonInfoResponse";
const FULL_NAME: &'static str = "media.v1.GetDaemonInfoResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetDaemonInfoResponse";
}
impl ::buffa::Message for GetDaemonInfoResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.version.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.version) as u32;
}
if self.started_at != 0i64 {
size += 1u32 + ::buffa::types::int64_encoded_len(self.started_at) as u32;
}
if self.total_videos != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_videos) as u32;
}
if self.total_scenes != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_scenes) as u32;
}
if self.active_tasks != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.active_tasks) 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.version.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.version, buf);
}
if self.started_at != 0i64 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(self.started_at, buf);
}
if self.total_videos != 0u64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_videos, buf);
}
if self.total_scenes != 0u64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_scenes, buf);
}
if self.active_tasks != 0u32 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.active_tasks, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.version = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.started_at = ::buffa::types::decode_int64(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_videos = ::buffa::types::decode_uint64(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_scenes = ::buffa::types::decode_uint64(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.active_tasks = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.version = ::core::default::Default::default();
self.started_at = 0i64;
self.total_videos = 0u64;
self.total_scenes = 0u64;
self.active_tasks = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetDaemonInfoResponse {
const PROTO_FQN: &'static str = "media.v1.GetDaemonInfoResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for GetDaemonInfoResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __GET_DAEMON_INFO_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.GetDaemonInfoResponse",
to_json: ::buffa::type_registry::any_to_json::<GetDaemonInfoResponse>,
from_json: ::buffa::type_registry::any_from_json::<GetDaemonInfoResponse>,
is_wkt: false,
};
/// ── Batch 4: composite responses (§7.5 folder.rs/search.rs/browse.rs/file.rs/
/// ```text
/// model.rs/progress.rs) ────────────────────────────────────────────────
/// ```
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Volume {
/// Field 1: `meta`
#[cfg_attr(
feature = "json",
serde(
rename = "meta",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub meta: ::buffa::MessageField<VolumeMeta>,
/// Field 2: `folders`
#[cfg_attr(
feature = "json",
serde(
rename = "folders",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub folders: ::buffa::alloc::vec::Vec<WatchedLocation>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Volume {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Volume")
.field("meta", &self.meta)
.field("folders", &self.folders)
.finish()
}
}
impl Volume {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Volume";
}
impl ::buffa::DefaultInstance for Volume {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Volume> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Volume {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Volume";
const FULL_NAME: &'static str = "media.v1.Volume";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Volume";
}
impl ::buffa::Message for Volume {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.meta.is_set() {
let __slot = __cache.reserve();
let inner_size = self.meta.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.folders {
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 _;
if self.meta.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.meta.write_to(__cache, buf);
}
for v in &self.folders {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.meta.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.folders.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.meta = ::buffa::MessageField::none();
self.folders.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Volume {
const PROTO_FQN: &'static str = "media.v1.Volume";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Volume {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VOLUME_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Volume",
to_json: ::buffa::type_registry::any_to_json::<Volume>,
from_json: ::buffa::type_registry::any_from_json::<Volume>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ListLocationsResponse {
/// Field 1: `groups`
#[cfg_attr(
feature = "json",
serde(
rename = "groups",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub groups: ::buffa::alloc::vec::Vec<Volume>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ListLocationsResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ListLocationsResponse").field("groups", &self.groups).finish()
}
}
impl ListLocationsResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ListLocationsResponse";
}
impl ::buffa::DefaultInstance for ListLocationsResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ListLocationsResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ListLocationsResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ListLocationsResponse";
const FULL_NAME: &'static str = "media.v1.ListLocationsResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ListLocationsResponse";
}
impl ::buffa::Message for ListLocationsResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.groups {
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.groups {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.groups.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.groups.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ListLocationsResponse {
const PROTO_FQN: &'static str = "media.v1.ListLocationsResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ListLocationsResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __LIST_LOCATIONS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ListLocationsResponse",
to_json: ::buffa::type_registry::any_to_json::<ListLocationsResponse>,
from_json: ::buffa::type_registry::any_from_json::<ListLocationsResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct GetLocationStatsResponse {
/// Field 1: `total_files`
#[cfg_attr(
feature = "json",
serde(
rename = "totalFiles",
alias = "total_files",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_files: u64,
/// Field 2: `indexed_files`
#[cfg_attr(
feature = "json",
serde(
rename = "indexedFiles",
alias = "indexed_files",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub indexed_files: u64,
/// Field 3: `total_videos`
#[cfg_attr(
feature = "json",
serde(
rename = "totalVideos",
alias = "total_videos",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_videos: u64,
/// Field 4: `total_scenes`
#[cfg_attr(
feature = "json",
serde(
rename = "totalScenes",
alias = "total_scenes",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_scenes: u64,
/// Field 5: `total_audios`
#[cfg_attr(
feature = "json",
serde(
rename = "totalAudios",
alias = "total_audios",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_audios: u64,
/// Field 6: `failed_files`
#[cfg_attr(
feature = "json",
serde(
rename = "failedFiles",
alias = "failed_files",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub failed_files: ::buffa::alloc::vec::Vec<NetFailedFile>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetLocationStatsResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetLocationStatsResponse")
.field("total_files", &self.total_files)
.field("indexed_files", &self.indexed_files)
.field("total_videos", &self.total_videos)
.field("total_scenes", &self.total_scenes)
.field("total_audios", &self.total_audios)
.field("failed_files", &self.failed_files)
.finish()
}
}
impl GetLocationStatsResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetLocationStatsResponse";
}
impl ::buffa::DefaultInstance for GetLocationStatsResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetLocationStatsResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetLocationStatsResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "GetLocationStatsResponse";
const FULL_NAME: &'static str = "media.v1.GetLocationStatsResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetLocationStatsResponse";
}
impl ::buffa::Message for GetLocationStatsResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.total_files != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_files) as u32;
}
if self.indexed_files != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.indexed_files) as u32;
}
if self.total_videos != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_videos) as u32;
}
if self.total_scenes != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_scenes) as u32;
}
if self.total_audios != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_audios) as u32;
}
for v in &self.failed_files {
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 _;
if self.total_files != 0u64 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_files, buf);
}
if self.indexed_files != 0u64 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.indexed_files, buf);
}
if self.total_videos != 0u64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_videos, buf);
}
if self.total_scenes != 0u64 {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_scenes, buf);
}
if self.total_audios != 0u64 {
::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_audios, buf);
}
for v in &self.failed_files {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_files = ::buffa::types::decode_uint64(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.indexed_files = ::buffa::types::decode_uint64(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_videos = ::buffa::types::decode_uint64(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_scenes = ::buffa::types::decode_uint64(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_audios = ::buffa::types::decode_uint64(buf)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.failed_files.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.total_files = 0u64;
self.indexed_files = 0u64;
self.total_videos = 0u64;
self.total_scenes = 0u64;
self.total_audios = 0u64;
self.failed_files.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetLocationStatsResponse {
const PROTO_FQN: &'static str = "media.v1.GetLocationStatsResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for GetLocationStatsResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __GET_LOCATION_STATS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.GetLocationStatsResponse",
to_json: ::buffa::type_registry::any_to_json::<GetLocationStatsResponse>,
from_json: ::buffa::type_registry::any_from_json::<GetLocationStatsResponse>,
is_wkt: false,
};
/// `location_id`: inline bytes (Id convention, §7.1).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct FailedFilesResponse {
/// Field 1: `location_id`
#[cfg_attr(
feature = "json",
serde(
rename = "locationId",
alias = "location_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub location_id: ::buffa::bytes::Bytes,
/// Field 2: `failed_files`
#[cfg_attr(
feature = "json",
serde(
rename = "failedFiles",
alias = "failed_files",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub failed_files: ::buffa::alloc::vec::Vec<NetFailedFile>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FailedFilesResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FailedFilesResponse")
.field("location_id", &self.location_id)
.field("failed_files", &self.failed_files)
.finish()
}
}
impl FailedFilesResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FailedFilesResponse";
}
impl ::buffa::DefaultInstance for FailedFilesResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FailedFilesResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for FailedFilesResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "FailedFilesResponse";
const FULL_NAME: &'static str = "media.v1.FailedFilesResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FailedFilesResponse";
}
impl ::buffa::Message for FailedFilesResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.location_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.location_id) as u32;
}
for v in &self.failed_files {
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 _;
if !self.location_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.location_id, buf);
}
for v in &self.failed_files {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.location_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.failed_files.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.location_id = ::buffa::bytes::Bytes::new();
self.failed_files.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FailedFilesResponse {
const PROTO_FQN: &'static str = "media.v1.FailedFilesResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for FailedFilesResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __FAILED_FILES_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.FailedFilesResponse",
to_json: ::buffa::type_registry::any_to_json::<FailedFilesResponse>,
from_json: ::buffa::type_registry::any_from_json::<FailedFilesResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct SearchRequest {
/// Field 1: `query`
#[cfg_attr(
feature = "json",
serde(
rename = "query",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub query: ::buffa::smol_str::SmolStr,
/// Field 2: `pagination`
#[cfg_attr(
feature = "json",
serde(
rename = "pagination",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub pagination: ::buffa::MessageField<Pagination>,
/// Field 3: `filters`
#[cfg_attr(
feature = "json",
serde(
rename = "filters",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub filters: ::buffa::alloc::vec::Vec<SearchFilter>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SearchRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SearchRequest")
.field("query", &self.query)
.field("pagination", &self.pagination)
.field("filters", &self.filters)
.finish()
}
}
impl SearchRequest {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SearchRequest";
}
impl ::buffa::DefaultInstance for SearchRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<SearchRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for SearchRequest {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "SearchRequest";
const FULL_NAME: &'static str = "media.v1.SearchRequest";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.SearchRequest";
}
impl ::buffa::Message for SearchRequest {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.query.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.query) as u32;
}
if self.pagination.is_set() {
let __slot = __cache.reserve();
let inner_size = self.pagination.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.filters {
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 _;
if !self.query.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.query, buf);
}
if self.pagination.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.pagination.write_to(__cache, buf);
}
for v in &self.filters {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.query = ::buffa::types::decode_string_to(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.pagination.get_or_insert_default(),
buf,
depth,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.filters.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.query = ::core::default::Default::default();
self.pagination = ::buffa::MessageField::none();
self.filters.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SearchRequest {
const PROTO_FQN: &'static str = "media.v1.SearchRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for SearchRequest {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __SEARCH_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.SearchRequest",
to_json: ::buffa::type_registry::any_to_json::<SearchRequest>,
from_json: ::buffa::type_registry::any_from_json::<SearchRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct BrowseResponse {
/// Field 1: `items`
#[cfg_attr(
feature = "json",
serde(
rename = "items",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub items: ::buffa::alloc::vec::Vec<BrowseItem>,
/// Field 2: `total_count`
#[cfg_attr(
feature = "json",
serde(
rename = "totalCount",
alias = "total_count",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub total_count: u32,
/// Field 3: `pagination`
#[cfg_attr(
feature = "json",
serde(
rename = "pagination",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub pagination: ::buffa::MessageField<Pagination>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BrowseResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BrowseResponse")
.field("items", &self.items)
.field("total_count", &self.total_count)
.field("pagination", &self.pagination)
.finish()
}
}
impl BrowseResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BrowseResponse";
}
impl ::buffa::DefaultInstance for BrowseResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<BrowseResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for BrowseResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "BrowseResponse";
const FULL_NAME: &'static str = "media.v1.BrowseResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.BrowseResponse";
}
impl ::buffa::Message for BrowseResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.items {
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;
}
if self.total_count != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.total_count) as u32;
}
if self.pagination.is_set() {
let __slot = __cache.reserve();
let inner_size = self.pagination.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.items {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if self.total_count != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.total_count, buf);
}
if self.pagination.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.pagination.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.items.push(elem);
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_count = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.pagination.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.items.clear();
self.total_count = 0u32;
self.pagination = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BrowseResponse {
const PROTO_FQN: &'static str = "media.v1.BrowseResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for BrowseResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __BROWSE_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.BrowseResponse",
to_json: ::buffa::type_registry::any_to_json::<BrowseResponse>,
from_json: ::buffa::type_registry::any_from_json::<BrowseResponse>,
is_wkt: false,
};
/// `video`/`scenes`: Video / Scene (SP2 DB domain,
/// same-package refs).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct GetIndexedFileResponse {
/// Field 1: `video`
#[cfg_attr(
feature = "json",
serde(
rename = "video",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub video: ::buffa::MessageField<Video>,
/// Field 2: `scenes`
#[cfg_attr(
feature = "json",
serde(
rename = "scenes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub scenes: ::buffa::alloc::vec::Vec<Scene>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetIndexedFileResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetIndexedFileResponse")
.field("video", &self.video)
.field("scenes", &self.scenes)
.finish()
}
}
impl GetIndexedFileResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetIndexedFileResponse";
}
impl ::buffa::DefaultInstance for GetIndexedFileResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetIndexedFileResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetIndexedFileResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "GetIndexedFileResponse";
const FULL_NAME: &'static str = "media.v1.GetIndexedFileResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetIndexedFileResponse";
}
impl ::buffa::Message for GetIndexedFileResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.video.is_set() {
let __slot = __cache.reserve();
let inner_size = self.video.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.scenes {
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 _;
if self.video.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.video.write_to(__cache, buf);
}
for v in &self.scenes {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.video.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.scenes.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.video = ::buffa::MessageField::none();
self.scenes.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetIndexedFileResponse {
const PROTO_FQN: &'static str = "media.v1.GetIndexedFileResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for GetIndexedFileResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __GET_INDEXED_FILE_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.GetIndexedFileResponse",
to_json: ::buffa::type_registry::any_to_json::<GetIndexedFileResponse>,
from_json: ::buffa::type_registry::any_from_json::<GetIndexedFileResponse>,
is_wkt: false,
};
/// `video_id`: inline bytes (Id convention, §7.1). `index_status`: inline
/// uint32 VideoIndexStatus (SP2 bitflag reused by-value, §7.4) — bits:
/// PROBED=0x01, SCENE_DETECTED=0x02, KEYFRAME_EXTRACTED=0x04,
/// VLM_ANALYZED=0x10, APPLE_VISION_ANALYZED=0x20,
/// TEXT_EMBEDDING_FINISHED=0x40, SCENE_EMBEDDING_FINISHED=0x80 (src gap at
/// 0x08). `error`: source Option\<ErrorInfo\> -\> optional ErrorInfo
/// (source normalizes empty-\>None; presence per §2).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct GetFileIndexingStatsResponse {
/// Field 1: `video_id`
#[cfg_attr(
feature = "json",
serde(
rename = "videoId",
alias = "video_id",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)
)]
#[cfg_attr(
feature = "arbitrary",
arbitrary(with = ::buffa::__private::arbitrary_bytes)
)]
pub video_id: ::buffa::bytes::Bytes,
/// Field 2: `index_status`
#[cfg_attr(
feature = "json",
serde(
rename = "indexStatus",
alias = "index_status",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub index_status: u32,
/// Field 3: `error`
#[cfg_attr(
feature = "json",
serde(
rename = "error",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub error: ::buffa::MessageField<ErrorInfo>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetFileIndexingStatsResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetFileIndexingStatsResponse")
.field("video_id", &self.video_id)
.field("index_status", &self.index_status)
.field("error", &self.error)
.finish()
}
}
impl GetFileIndexingStatsResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetFileIndexingStatsResponse";
}
impl ::buffa::DefaultInstance for GetFileIndexingStatsResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetFileIndexingStatsResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetFileIndexingStatsResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "GetFileIndexingStatsResponse";
const FULL_NAME: &'static str = "media.v1.GetFileIndexingStatsResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetFileIndexingStatsResponse";
}
impl ::buffa::Message for GetFileIndexingStatsResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.video_id.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.video_id) as u32;
}
if self.index_status != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.index_status) as u32;
}
if self.error.is_set() {
let __slot = __cache.reserve();
let inner_size = self.error.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.video_id.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_bytes(&self.video_id, buf);
}
if self.index_status != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.index_status, buf);
}
if self.error.is_set() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.error.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.video_id = ::buffa::types::decode_bytes_to_bytes(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.index_status = ::buffa::types::decode_uint32(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.error.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.video_id = ::buffa::bytes::Bytes::new();
self.index_status = 0u32;
self.error = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetFileIndexingStatsResponse {
const PROTO_FQN: &'static str = "media.v1.GetFileIndexingStatsResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for GetFileIndexingStatsResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __GET_FILE_INDEXING_STATS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.GetFileIndexingStatsResponse",
to_json: ::buffa::type_registry::any_to_json::<GetFileIndexingStatsResponse>,
from_json: ::buffa::type_registry::any_from_json::<GetFileIndexingStatsResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct GetModelStatusResponse {
/// Field 1: `models`
#[cfg_attr(
feature = "json",
serde(
rename = "models",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub models: ::buffa::alloc::vec::Vec<ModelInfo>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetModelStatusResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetModelStatusResponse").field("models", &self.models).finish()
}
}
impl GetModelStatusResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetModelStatusResponse";
}
impl ::buffa::DefaultInstance for GetModelStatusResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetModelStatusResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetModelStatusResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "GetModelStatusResponse";
const FULL_NAME: &'static str = "media.v1.GetModelStatusResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.GetModelStatusResponse";
}
impl ::buffa::Message for GetModelStatusResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.models {
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.models {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.models.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.models.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetModelStatusResponse {
const PROTO_FQN: &'static str = "media.v1.GetModelStatusResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for GetModelStatusResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __GET_MODEL_STATUS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.GetModelStatusResponse",
to_json: ::buffa::type_registry::any_to_json::<GetModelStatusResponse>,
from_json: ::buffa::type_registry::any_from_json::<GetModelStatusResponse>,
is_wkt: false,
};
/// Thin wrapper kept as a named message — distinct RESPONSE role; references
/// the shared batch-2 ModelDownloadProgress leaf (NOT a re-typed copy). NOT
/// collapsed: it is a separate decode target from ModelDownloadProgressEvent
/// in the source dispatch (response vs push role, §7.8 #4/#10).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ModelDownloadProgressResponse {
/// Field 1: `model`
#[cfg_attr(
feature = "json",
serde(
rename = "model",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub model: ::buffa::MessageField<ModelDownloadProgress>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ModelDownloadProgressResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ModelDownloadProgressResponse")
.field("model", &self.model)
.finish()
}
}
impl ModelDownloadProgressResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ModelDownloadProgressResponse";
}
impl ::buffa::DefaultInstance for ModelDownloadProgressResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ModelDownloadProgressResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ModelDownloadProgressResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ModelDownloadProgressResponse";
const FULL_NAME: &'static str = "media.v1.ModelDownloadProgressResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ModelDownloadProgressResponse";
}
impl ::buffa::Message for ModelDownloadProgressResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.model.is_set() {
let __slot = __cache.reserve();
let inner_size = self.model.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.model.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.model.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.model.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.model = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ModelDownloadProgressResponse {
const PROTO_FQN: &'static str = "media.v1.ModelDownloadProgressResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ModelDownloadProgressResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __MODEL_DOWNLOAD_PROGRESS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ModelDownloadProgressResponse",
to_json: ::buffa::type_registry::any_to_json::<ModelDownloadProgressResponse>,
from_json: ::buffa::type_registry::any_from_json::<ModelDownloadProgressResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct IndexingProgressResponse {
/// Field 1: `location`
#[cfg_attr(
feature = "json",
serde(
rename = "location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub location: ::buffa::MessageField<Location>,
/// Field 2: `total_files`
#[cfg_attr(
feature = "json",
serde(
rename = "totalFiles",
alias = "total_files",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub total_files: u64,
/// Field 3: `indexed_files`
#[cfg_attr(
feature = "json",
serde(
rename = "indexedFiles",
alias = "indexed_files",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub indexed_files: u64,
/// Field 4: `active_files`
#[cfg_attr(
feature = "json",
serde(
rename = "activeFiles",
alias = "active_files",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)
)]
pub active_files: ::buffa::alloc::vec::Vec<IndexingFile>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for IndexingProgressResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("IndexingProgressResponse")
.field("location", &self.location)
.field("total_files", &self.total_files)
.field("indexed_files", &self.indexed_files)
.field("active_files", &self.active_files)
.finish()
}
}
impl IndexingProgressResponse {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.IndexingProgressResponse";
}
impl ::buffa::DefaultInstance for IndexingProgressResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<IndexingProgressResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for IndexingProgressResponse {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "IndexingProgressResponse";
const FULL_NAME: &'static str = "media.v1.IndexingProgressResponse";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.IndexingProgressResponse";
}
impl ::buffa::Message for IndexingProgressResponse {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.location.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.total_files != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.total_files) as u32;
}
if self.indexed_files != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.indexed_files) as u32;
}
for v in &self.active_files {
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 _;
if self.location.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.location.write_to(__cache, buf);
}
if self.total_files != 0u64 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.total_files, buf);
}
if self.indexed_files != 0u64 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.indexed_files, buf);
}
for v in &self.active_files {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.location.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.total_files = ::buffa::types::decode_uint64(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.indexed_files = ::buffa::types::decode_uint64(buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.active_files.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.location = ::buffa::MessageField::none();
self.total_files = 0u64;
self.indexed_files = 0u64;
self.active_files.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for IndexingProgressResponse {
const PROTO_FQN: &'static str = "media.v1.IndexingProgressResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for IndexingProgressResponse {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __INDEXING_PROGRESS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.IndexingProgressResponse",
to_json: ::buffa::type_registry::any_to_json::<IndexingProgressResponse>,
from_json: ::buffa::type_registry::any_from_json::<IndexingProgressResponse>,
is_wkt: false,
};
/// ── Batch 5: events (§7.5 event.rs) ─────────────────────────────────────────
///
/// `event`: bare u32 enum-by-convention (NOT a proto enum, §7.3) —
/// 0=mounted, 1=unmounted, 2=ejected. Out-of-set values round-trip exactly.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct VolumeStateChangedEvent {
/// Field 1: `volume`
#[cfg_attr(
feature = "json",
serde(
rename = "volume",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub volume: ::buffa::MessageField<VolumeMeta>,
/// Field 2: `event`
#[cfg_attr(
feature = "json",
serde(
rename = "event",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub event: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for VolumeStateChangedEvent {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("VolumeStateChangedEvent")
.field("volume", &self.volume)
.field("event", &self.event)
.finish()
}
}
impl VolumeStateChangedEvent {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VolumeStateChangedEvent";
}
impl ::buffa::DefaultInstance for VolumeStateChangedEvent {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<VolumeStateChangedEvent> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for VolumeStateChangedEvent {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "VolumeStateChangedEvent";
const FULL_NAME: &'static str = "media.v1.VolumeStateChangedEvent";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.VolumeStateChangedEvent";
}
impl ::buffa::Message for VolumeStateChangedEvent {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.volume.is_set() {
let __slot = __cache.reserve();
let inner_size = self.volume.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if self.event != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.event) 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.volume.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.volume.write_to(__cache, buf);
}
if self.event != 0u32 {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.event, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.volume.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.event = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.volume = ::buffa::MessageField::none();
self.event = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for VolumeStateChangedEvent {
const PROTO_FQN: &'static str = "media.v1.VolumeStateChangedEvent";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for VolumeStateChangedEvent {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __VOLUME_STATE_CHANGED_EVENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.VolumeStateChangedEvent",
to_json: ::buffa::type_registry::any_to_json::<VolumeStateChangedEvent>,
from_json: ::buffa::type_registry::any_from_json::<VolumeStateChangedEvent>,
is_wkt: false,
};
/// `event`: bare u32 enum-by-convention (NOT a proto enum, §7.3) —
/// 0=file_created, 1=file_modified, 2=file_removed. Out-of-set values
/// round-trip exactly.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct FolderUpdatedEvent {
/// Field 1: `folder_location`
#[cfg_attr(
feature = "json",
serde(
rename = "folderLocation",
alias = "folder_location",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub folder_location: ::buffa::MessageField<Location>,
/// Field 2: `path`
#[cfg_attr(
feature = "json",
serde(
rename = "path",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)
)]
pub path: ::buffa::smol_str::SmolStr,
/// Field 3: `event`
#[cfg_attr(
feature = "json",
serde(
rename = "event",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)
)]
pub event: u32,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for FolderUpdatedEvent {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FolderUpdatedEvent")
.field("folder_location", &self.folder_location)
.field("path", &self.path)
.field("event", &self.event)
.finish()
}
}
impl FolderUpdatedEvent {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FolderUpdatedEvent";
}
impl ::buffa::DefaultInstance for FolderUpdatedEvent {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<FolderUpdatedEvent> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for FolderUpdatedEvent {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "FolderUpdatedEvent";
const FULL_NAME: &'static str = "media.v1.FolderUpdatedEvent";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.FolderUpdatedEvent";
}
impl ::buffa::Message for FolderUpdatedEvent {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.folder_location.is_set() {
let __slot = __cache.reserve();
let inner_size = self.folder_location.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if !self.path.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.path) as u32;
}
if self.event != 0u32 {
size += 1u32 + ::buffa::types::uint32_encoded_len(self.event) 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.folder_location.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.folder_location.write_to(__cache, buf);
}
if !self.path.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.path, buf);
}
if self.event != 0u32 {
::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint32(self.event, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.folder_location.get_or_insert_default(),
buf,
depth,
)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
self.path = ::buffa::types::decode_string_to(buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.event = ::buffa::types::decode_uint32(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.folder_location = ::buffa::MessageField::none();
self.path = ::core::default::Default::default();
self.event = 0u32;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for FolderUpdatedEvent {
const PROTO_FQN: &'static str = "media.v1.FolderUpdatedEvent";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for FolderUpdatedEvent {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __FOLDER_UPDATED_EVENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.FolderUpdatedEvent",
to_json: ::buffa::type_registry::any_to_json::<FolderUpdatedEvent>,
from_json: ::buffa::type_registry::any_from_json::<FolderUpdatedEvent>,
is_wkt: false,
};
/// Thin wrapper kept as a named message — distinct PUSH/EVENT role (the
/// uncorrelated server-push Event arm at discriminant tag 20002); same wire
/// shape as ModelDownloadProgressResponse but a separate type per its source
/// role; references the shared batch-2 ModelDownloadProgress leaf (NOT a
/// re-typed copy). NOT collapsed (§7.8 #4/#10).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ModelDownloadProgressEvent {
/// Field 1: `model`
#[cfg_attr(
feature = "json",
serde(
rename = "model",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub model: ::buffa::MessageField<ModelDownloadProgress>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ModelDownloadProgressEvent {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ModelDownloadProgressEvent").field("model", &self.model).finish()
}
}
impl ModelDownloadProgressEvent {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ModelDownloadProgressEvent";
}
impl ::buffa::DefaultInstance for ModelDownloadProgressEvent {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ModelDownloadProgressEvent> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ModelDownloadProgressEvent {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ModelDownloadProgressEvent";
const FULL_NAME: &'static str = "media.v1.ModelDownloadProgressEvent";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ModelDownloadProgressEvent";
}
impl ::buffa::Message for ModelDownloadProgressEvent {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.model.is_set() {
let __slot = __cache.reserve();
let inner_size = self.model.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.model.is_set() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.model.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.model.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.model = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ModelDownloadProgressEvent {
const PROTO_FQN: &'static str = "media.v1.ModelDownloadProgressEvent";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ModelDownloadProgressEvent {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __MODEL_DOWNLOAD_PROGRESS_EVENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ModelDownloadProgressEvent",
to_json: ::buffa::type_registry::any_to_json::<ModelDownloadProgressEvent>,
from_json: ::buffa::type_registry::any_from_json::<ModelDownloadProgressEvent>,
is_wkt: false,
};
/// ── Batch 6: Request oneof envelope (§7.5 mod.rs) ───────────────────────────
///
/// Rust enum-with-data -\> proto3 message + single `oneof kind` (owned;
/// mirrors SP2 SubtitleTrackOrigin). Each arm's tag is the source
/// MessageType discriminant integer, VERBATIM (sparse, deliberately-banded:
/// 1 / 500–501 / 1000s / 2000s) — emitted with NO `reserved` per §2's
/// wide-band rule and the SP2 §6.8 #3 AudioAnalysis/TrackRecord precedent.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Request {
#[cfg_attr(feature = "json", serde(flatten))]
pub kind: ::core::option::Option<__buffa::oneof::request::Kind>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Request {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Request").field("kind", &self.kind).finish()
}
}
impl Request {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Request";
}
impl ::buffa::DefaultInstance for Request {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Request> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Request {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Request";
const FULL_NAME: &'static str = "media.v1.Request";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Request";
}
impl ::buffa::Message for Request {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.kind {
match v {
__buffa::oneof::request::Kind::Heartbeat(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::request::Kind::Search(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::Browse(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::GetLocationStats(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::ListLocations(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::GetIndexedFile(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::GetFileIndexingStats(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::GetModelStatus(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::GetDaemonInfo(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::IndexLocation(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::RemoveLocation(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::UpdateAnnotation(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::EjectVolume(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::request::Kind::RetryFailed(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 2u32 + ::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.kind {
match v {
__buffa::oneof::request::Kind::Heartbeat(x) => {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::Search(x) => {
::buffa::encoding::Tag::new(
500u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::Browse(x) => {
::buffa::encoding::Tag::new(
501u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::GetLocationStats(x) => {
::buffa::encoding::Tag::new(
1000u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::ListLocations(x) => {
::buffa::encoding::Tag::new(
1001u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::GetIndexedFile(x) => {
::buffa::encoding::Tag::new(
1002u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::GetFileIndexingStats(x) => {
::buffa::encoding::Tag::new(
1003u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::GetModelStatus(x) => {
::buffa::encoding::Tag::new(
1004u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::GetDaemonInfo(x) => {
::buffa::encoding::Tag::new(
1007u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::IndexLocation(x) => {
::buffa::encoding::Tag::new(
2000u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::RemoveLocation(x) => {
::buffa::encoding::Tag::new(
2001u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::UpdateAnnotation(x) => {
::buffa::encoding::Tag::new(
2002u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::EjectVolume(x) => {
::buffa::encoding::Tag::new(
2003u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::request::Kind::RetryFailed(x) => {
::buffa::encoding::Tag::new(
2005u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::Heartbeat(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::Heartbeat(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
500u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 500u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::Search(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::Search(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
501u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 501u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::Browse(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::Browse(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
1000u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1000u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::GetLocationStats(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::GetLocationStats(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
1001u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1001u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::ListLocations(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::ListLocations(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
1002u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1002u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::GetIndexedFile(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::GetIndexedFile(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
1003u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1003u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::GetFileIndexingStats(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::GetFileIndexingStats(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
1004u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1004u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::GetModelStatus(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::GetModelStatus(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
1007u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1007u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::GetDaemonInfo(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::GetDaemonInfo(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
2000u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2000u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::IndexLocation(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::IndexLocation(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
2001u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2001u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::RemoveLocation(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::RemoveLocation(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
2002u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2002u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::UpdateAnnotation(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::UpdateAnnotation(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
2003u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2003u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::EjectVolume(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::EjectVolume(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
2005u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2005u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::request::Kind::RetryFailed(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::request::Kind::RetryFailed(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.kind = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Request {
const PROTO_FQN: &'static str = "media.v1.Request";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl<'de> serde::Deserialize<'de> for Request {
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 = Request;
fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("struct Request")
}
#[allow(clippy::field_reassign_with_default)]
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
mut map: A,
) -> ::core::result::Result<Request, A::Error> {
let mut __oneof_kind: ::core::option::Option<
__buffa::oneof::request::Kind,
> = None;
while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
match key.as_str() {
"heartbeat" => {
let v: ::core::option::Option<HeartbeatRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
HeartbeatRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::Heartbeat(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"search" => {
let v: ::core::option::Option<SearchRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
SearchRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::Search(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"browse" => {
let v: ::core::option::Option<BrowseRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
BrowseRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::Browse(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"getLocationStats" | "get_location_stats" => {
let v: ::core::option::Option<GetLocationStatsRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
GetLocationStatsRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::GetLocationStats(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"listLocations" | "list_locations" => {
let v: ::core::option::Option<ListLocationsRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
ListLocationsRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::ListLocations(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"getIndexedFile" | "get_indexed_file" => {
let v: ::core::option::Option<GetIndexedFileRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
GetIndexedFileRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::GetIndexedFile(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"getFileIndexingStats" | "get_file_indexing_stats" => {
let v: ::core::option::Option<GetFileIndexingStatsRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
GetFileIndexingStatsRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::GetFileIndexingStats(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"getModelStatus" | "get_model_status" => {
let v: ::core::option::Option<GetModelStatusRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
GetModelStatusRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::GetModelStatus(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"getDaemonInfo" | "get_daemon_info" => {
let v: ::core::option::Option<GetDaemonInfoRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
GetDaemonInfoRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::GetDaemonInfo(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"indexLocation" | "index_location" => {
let v: ::core::option::Option<IndexLocationRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
IndexLocationRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::IndexLocation(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"removeLocation" | "remove_location" => {
let v: ::core::option::Option<RemoveLocationRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
RemoveLocationRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::RemoveLocation(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"updateAnnotation" | "update_annotation" => {
let v: ::core::option::Option<UpdateAnnotationRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
UpdateAnnotationRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::UpdateAnnotation(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"ejectVolume" | "eject_volume" => {
let v: ::core::option::Option<EjectVolumeRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
EjectVolumeRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::EjectVolume(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"retryFailed" | "retry_failed" => {
let v: ::core::option::Option<RetryFailedRequest> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
RetryFailedRequest,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::request::Kind::RetryFailed(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
_ => {
map.next_value::<serde::de::IgnoredAny>()?;
}
}
}
let mut __r = <Request as ::core::default::Default>::default();
__r.kind = __oneof_kind;
Ok(__r)
}
}
d.deserialize_map(_V)
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Request {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Request",
to_json: ::buffa::type_registry::any_to_json::<Request>,
from_json: ::buffa::type_registry::any_from_json::<Request>,
is_wkt: false,
};
pub mod request {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::request::Kind;
}
/// ── Batch 7: Response oneof envelope (§7.5 mod.rs) ──────────────────────────
///
/// Rust enum-with-data -\> proto3 message + single `oneof kind` (owned;
/// mirrors SP2 SubtitleTrackOrigin). 15 arms (§7.8 #1: mod.rs defines 15,
/// incl. ErrorResponse=19999). Each arm's tag is the source MessageType
/// discriminant integer, VERBATIM (sparse bands 10000s / 12000s / 20000
/// (error remapped from reserved 19999, §7.8)) — NO `reserved` per §2's
/// wide-band rule / SP2 §6.8 #3 precedent. The `error` arm references
/// ErrorInfo DIRECTLY (the source thin error.rs::ErrorResponse
/// {error:ErrorInfo} wrapper is collapsed, §7.8 #4 — NO
/// ErrorResponse type). The error arm tag is 20000, NOT the
/// source MessageType::ErrorResponse=19999: protobuf reserves field numbers
/// 19000-19999, and §2's NO-wire-compat invariant makes the source
/// discriminant non-binding — remapped to the next clean non-reserved high
/// sentinel (§7.8).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Response {
#[cfg_attr(feature = "json", serde(flatten))]
pub kind: ::core::option::Option<__buffa::oneof::response::Kind>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Response {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Response").field("kind", &self.kind).finish()
}
}
impl Response {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Response";
}
impl ::buffa::DefaultInstance for Response {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Response> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Response {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Response";
const FULL_NAME: &'static str = "media.v1.Response";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Response";
}
impl ::buffa::Message for Response {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.kind {
match v {
__buffa::oneof::response::Kind::Heartbeat(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::Search(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::Browse(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::GetIndexedFile(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::ListLocations(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::GetLocationStats(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::GetFileIndexingStats(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::GetModelStatus(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::GetDaemonInfo(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::IndexLocation(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::RemoveLocation(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::UpdateAnnotation(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::EjectVolume(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::RetryFailed(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::response::Kind::Error(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::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.kind {
match v {
__buffa::oneof::response::Kind::Heartbeat(x) => {
::buffa::encoding::Tag::new(
10001u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::Search(x) => {
::buffa::encoding::Tag::new(
10500u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::Browse(x) => {
::buffa::encoding::Tag::new(
10501u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::GetIndexedFile(x) => {
::buffa::encoding::Tag::new(
11002u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::ListLocations(x) => {
::buffa::encoding::Tag::new(
11003u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::GetLocationStats(x) => {
::buffa::encoding::Tag::new(
11004u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::GetFileIndexingStats(x) => {
::buffa::encoding::Tag::new(
11005u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::GetModelStatus(x) => {
::buffa::encoding::Tag::new(
11006u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::GetDaemonInfo(x) => {
::buffa::encoding::Tag::new(
11009u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::IndexLocation(x) => {
::buffa::encoding::Tag::new(
12000u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::RemoveLocation(x) => {
::buffa::encoding::Tag::new(
12001u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::UpdateAnnotation(x) => {
::buffa::encoding::Tag::new(
12003u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::EjectVolume(x) => {
::buffa::encoding::Tag::new(
12004u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::RetryFailed(x) => {
::buffa::encoding::Tag::new(
12006u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::response::Kind::Error(x) => {
::buffa::encoding::Tag::new(
20000u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
10001u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10001u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::Heartbeat(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::Heartbeat(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
10500u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10500u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::Search(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::Search(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
10501u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10501u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::Browse(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::Browse(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
11002u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11002u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::GetIndexedFile(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::GetIndexedFile(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
11003u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11003u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::ListLocations(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::ListLocations(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
11004u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11004u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::GetLocationStats(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::GetLocationStats(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
11005u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11005u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::GetFileIndexingStats(
ref mut existing,
),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::GetFileIndexingStats(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
11006u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11006u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::GetModelStatus(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::GetModelStatus(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
11009u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11009u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::GetDaemonInfo(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::GetDaemonInfo(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
12000u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12000u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::IndexLocation(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::IndexLocation(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
12001u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12001u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::RemoveLocation(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::RemoveLocation(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
12003u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12003u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::UpdateAnnotation(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::UpdateAnnotation(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
12004u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12004u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::EjectVolume(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::EjectVolume(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
12006u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12006u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::RetryFailed(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::RetryFailed(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
20000u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20000u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::response::Kind::Error(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::response::Kind::Error(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.kind = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Response {
const PROTO_FQN: &'static str = "media.v1.Response";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl<'de> serde::Deserialize<'de> for Response {
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 = Response;
fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("struct Response")
}
#[allow(clippy::field_reassign_with_default)]
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
mut map: A,
) -> ::core::result::Result<Response, A::Error> {
let mut __oneof_kind: ::core::option::Option<
__buffa::oneof::response::Kind,
> = None;
while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
match key.as_str() {
"heartbeat" => {
let v: ::core::option::Option<HeartbeatResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
HeartbeatResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::Heartbeat(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"search" => {
let v: ::core::option::Option<SearchResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
SearchResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::Search(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"browse" => {
let v: ::core::option::Option<BrowseResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
BrowseResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::Browse(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"getIndexedFile" | "get_indexed_file" => {
let v: ::core::option::Option<GetIndexedFileResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
GetIndexedFileResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::GetIndexedFile(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"listLocations" | "list_locations" => {
let v: ::core::option::Option<ListLocationsResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
ListLocationsResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::ListLocations(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"getLocationStats" | "get_location_stats" => {
let v: ::core::option::Option<GetLocationStatsResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
GetLocationStatsResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::GetLocationStats(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"getFileIndexingStats" | "get_file_indexing_stats" => {
let v: ::core::option::Option<
GetFileIndexingStatsResponse,
> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
GetFileIndexingStatsResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::GetFileIndexingStats(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"getModelStatus" | "get_model_status" => {
let v: ::core::option::Option<GetModelStatusResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
GetModelStatusResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::GetModelStatus(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"getDaemonInfo" | "get_daemon_info" => {
let v: ::core::option::Option<GetDaemonInfoResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
GetDaemonInfoResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::GetDaemonInfo(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"indexLocation" | "index_location" => {
let v: ::core::option::Option<IndexLocationResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
IndexLocationResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::IndexLocation(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"removeLocation" | "remove_location" => {
let v: ::core::option::Option<RemoveLocationResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
RemoveLocationResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::RemoveLocation(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"updateAnnotation" | "update_annotation" => {
let v: ::core::option::Option<UpdateAnnotationResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
UpdateAnnotationResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::UpdateAnnotation(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"ejectVolume" | "eject_volume" => {
let v: ::core::option::Option<EjectVolumeResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
EjectVolumeResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::EjectVolume(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"retryFailed" | "retry_failed" => {
let v: ::core::option::Option<RetryFailedResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
RetryFailedResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::RetryFailed(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"error" => {
let v: ::core::option::Option<ErrorInfo> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
ErrorInfo,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::response::Kind::Error(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
_ => {
map.next_value::<serde::de::IgnoredAny>()?;
}
}
}
let mut __r = <Response as ::core::default::Default>::default();
__r.kind = __oneof_kind;
Ok(__r)
}
}
d.deserialize_map(_V)
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Response {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Response",
to_json: ::buffa::type_registry::any_to_json::<Response>,
from_json: ::buffa::type_registry::any_from_json::<Response>,
is_wkt: false,
};
pub mod response {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::response::Kind;
}
/// ── Batch 8: Event oneof envelope (§7.5 mod.rs) ─────────────────────────────
///
/// Rust enum-with-data -\> proto3 message + single `oneof kind` (owned;
/// mirrors SP2 SubtitleTrackOrigin). 5 arms. Each arm's tag is the source
/// MessageType discriminant integer, VERBATIM (sparse: 13000 / 12007 /
/// 20000–20002) — NO `reserved` per §2's wide-band rule / SP2 §6.8 #3
/// precedent. `progress`/`failed_files` arms reuse the batch-4
/// IndexingProgressResponse / FailedFilesResponse messages (§7.5). Event has
/// NO correlation envelope (uncorrelated server-push, §7.8 #3).
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct Event {
#[cfg_attr(feature = "json", serde(flatten))]
pub kind: ::core::option::Option<__buffa::oneof::event::Kind>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for Event {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Event").field("kind", &self.kind).finish()
}
}
impl Event {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Event";
}
impl ::buffa::DefaultInstance for Event {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<Event> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for Event {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "Event";
const FULL_NAME: &'static str = "media.v1.Event";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.Event";
}
impl ::buffa::Message for Event {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.kind {
match v {
__buffa::oneof::event::Kind::FailedFiles(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::event::Kind::IndexingProgress(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::event::Kind::VolumeStateChanged(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::event::Kind::FolderUpdated(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::event::Kind::ModelDownloadProgress(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 3u32 + ::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.kind {
match v {
__buffa::oneof::event::Kind::FailedFiles(x) => {
::buffa::encoding::Tag::new(
12007u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::event::Kind::IndexingProgress(x) => {
::buffa::encoding::Tag::new(
13000u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::event::Kind::VolumeStateChanged(x) => {
::buffa::encoding::Tag::new(
20000u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::event::Kind::FolderUpdated(x) => {
::buffa::encoding::Tag::new(
20001u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
x.write_to(__cache, buf);
}
__buffa::oneof::event::Kind::ModelDownloadProgress(x) => {
::buffa::encoding::Tag::new(
20002u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, 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,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
12007u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12007u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::event::Kind::FailedFiles(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::event::Kind::FailedFiles(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
13000u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13000u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::event::Kind::IndexingProgress(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::event::Kind::IndexingProgress(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
20000u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20000u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::event::Kind::VolumeStateChanged(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::event::Kind::VolumeStateChanged(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
20001u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20001u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::event::Kind::FolderUpdated(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::event::Kind::FolderUpdated(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
20002u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 20002u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if let ::core::option::Option::Some(
__buffa::oneof::event::Kind::ModelDownloadProgress(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
depth,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, depth)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::event::Kind::ModelDownloadProgress(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.kind = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for Event {
const PROTO_FQN: &'static str = "media.v1.Event";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl<'de> serde::Deserialize<'de> for Event {
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 = Event;
fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("struct Event")
}
#[allow(clippy::field_reassign_with_default)]
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
mut map: A,
) -> ::core::result::Result<Event, A::Error> {
let mut __oneof_kind: ::core::option::Option<
__buffa::oneof::event::Kind,
> = None;
while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
match key.as_str() {
"failedFiles" | "failed_files" => {
let v: ::core::option::Option<FailedFilesResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
FailedFilesResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::event::Kind::FailedFiles(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"indexingProgress" | "indexing_progress" => {
let v: ::core::option::Option<IndexingProgressResponse> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
IndexingProgressResponse,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::event::Kind::IndexingProgress(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"volumeStateChanged" | "volume_state_changed" => {
let v: ::core::option::Option<VolumeStateChangedEvent> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
VolumeStateChangedEvent,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::event::Kind::VolumeStateChanged(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"folderUpdated" | "folder_updated" => {
let v: ::core::option::Option<FolderUpdatedEvent> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
FolderUpdatedEvent,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::event::Kind::FolderUpdated(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"modelDownloadProgress" | "model_download_progress" => {
let v: ::core::option::Option<ModelDownloadProgressEvent> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
ModelDownloadProgressEvent,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_kind.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'kind'",
),
);
}
__oneof_kind = Some(
__buffa::oneof::event::Kind::ModelDownloadProgress(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
_ => {
map.next_value::<serde::de::IgnoredAny>()?;
}
}
}
let mut __r = <Event as ::core::default::Default>::default();
__r.kind = __oneof_kind;
Ok(__r)
}
}
d.deserialize_map(_V)
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for Event {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __EVENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.Event",
to_json: ::buffa::type_registry::any_to_json::<Event>,
from_json: ::buffa::type_registry::any_from_json::<Event>,
is_wkt: false,
};
pub mod event {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::event::Kind;
}
/// ── Batch 9: correlation envelopes (§7.5 mod.rs; §7.8 #3) ───────────────────
///
/// `Payload<Request>` monomorphized (proto3 has no generics, §7.8 #3).
/// `request_id`: the src RequestId u64 newtype inlined as uint64 (§7.2);
/// request_id=0 =\> no-correlation default (matches the source
/// RequestId::from_raw(0) Default and the `id.value()!=0` encode guard) —
/// plain uint64, NOT `optional`. `request`: the batch-6 Request oneof
/// envelope.
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct RequestEnvelope {
/// Field 1: `request_id`
#[cfg_attr(
feature = "json",
serde(
rename = "requestId",
alias = "request_id",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub request_id: u64,
/// Field 2: `request`
#[cfg_attr(
feature = "json",
serde(
rename = "request",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub request: ::buffa::MessageField<Request>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for RequestEnvelope {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("RequestEnvelope")
.field("request_id", &self.request_id)
.field("request", &self.request)
.finish()
}
}
impl RequestEnvelope {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.RequestEnvelope";
}
impl ::buffa::DefaultInstance for RequestEnvelope {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<RequestEnvelope> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for RequestEnvelope {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "RequestEnvelope";
const FULL_NAME: &'static str = "media.v1.RequestEnvelope";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.RequestEnvelope";
}
impl ::buffa::Message for RequestEnvelope {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.request_id != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.request_id) as u32;
}
if self.request.is_set() {
let __slot = __cache.reserve();
let inner_size = self.request.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.request_id != 0u64 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.request_id, buf);
}
if self.request.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.request.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.request_id = ::buffa::types::decode_uint64(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.request.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.request_id = 0u64;
self.request = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for RequestEnvelope {
const PROTO_FQN: &'static str = "media.v1.RequestEnvelope";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for RequestEnvelope {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __REQUEST_ENVELOPE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.RequestEnvelope",
to_json: ::buffa::type_registry::any_to_json::<RequestEnvelope>,
from_json: ::buffa::type_registry::any_from_json::<RequestEnvelope>,
is_wkt: false,
};
/// `Payload<Response>` monomorphized. Same request_id convention. The source
/// RequestMessage=Payload\<Request\> / ResponseMessage=Payload\<Response\>
/// aliases are NOT separate types. `response`: the batch-7 Response oneof
/// envelope. (Event has NO envelope — uncorrelated push, §7.8 #3.)
#[derive(Clone, PartialEq, Default)]
#[cfg_attr(feature = "json", derive(::serde::Serialize, ::serde::Deserialize))]
#[cfg_attr(feature = "json", serde(default))]
#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
pub struct ResponseEnvelope {
/// Field 1: `request_id`
#[cfg_attr(
feature = "json",
serde(
rename = "requestId",
alias = "request_id",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)
)]
pub request_id: u64,
/// Field 2: `response`
#[cfg_attr(
feature = "json",
serde(
rename = "response",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)
)]
pub response: ::buffa::MessageField<Response>,
#[cfg_attr(feature = "json", serde(skip))]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ResponseEnvelope {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ResponseEnvelope")
.field("request_id", &self.request_id)
.field("response", &self.response)
.finish()
}
}
impl ResponseEnvelope {
/// Protobuf type URL for this message, for use with `Any::pack` and
/// `Any::unpack_if`.
///
/// Format: `type.googleapis.com/<fully.qualified.TypeName>`
pub const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ResponseEnvelope";
}
impl ::buffa::DefaultInstance for ResponseEnvelope {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ResponseEnvelope> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ResponseEnvelope {
const PACKAGE: &'static str = "media.v1";
const NAME: &'static str = "ResponseEnvelope";
const FULL_NAME: &'static str = "media.v1.ResponseEnvelope";
const TYPE_URL: &'static str = "type.googleapis.com/media.v1.ResponseEnvelope";
}
impl ::buffa::Message for ResponseEnvelope {
/// Returns the total encoded size in bytes.
///
/// The result is a `u32`; the protobuf specification requires all
/// messages to fit within 2 GiB (2,147,483,647 bytes), so a
/// compliant message will never overflow this type.
#[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.request_id != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.request_id) as u32;
}
if self.response.is_set() {
let __slot = __cache.reserve();
let inner_size = self.response.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.request_id != 0u64 {
::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_uint64(self.request_id, buf);
}
if self.response.is_set() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
self.response.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,
depth: u32,
) -> ::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 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.request_id = ::buffa::types::decode_uint64(buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::Message::merge_length_delimited(
self.response.get_or_insert_default(),
buf,
depth,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.request_id = 0u64;
self.response = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ResponseEnvelope {
const PROTO_FQN: &'static str = "media.v1.ResponseEnvelope";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
#[cfg(feature = "json")]
impl ::buffa::json_helpers::ProtoElemJson for ResponseEnvelope {
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)
}
}
#[cfg(feature = "json")]
#[doc(hidden)]
pub const __RESPONSE_ENVELOPE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/media.v1.ResponseEnvelope",
to_json: ::buffa::type_registry::any_to_json::<ResponseEnvelope>,
from_json: ::buffa::type_registry::any_from_json::<ResponseEnvelope>,
is_wkt: false,
};