Skip to main content

kunobi_daemon/wire/
generated.rs

1// @generated by buffa-codegen. DO NOT EDIT.
2// source: lifecycle.proto
3
4/// Separates shared lifecycle operation IDs from application-owned operation IDs.
5#[allow(non_camel_case_types)]
6#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
7#[repr(i32)]
8pub enum MessageKind {
9    /// Operations maintained by kunobi-daemon.
10    LIFECYCLE = 0i32,
11    /// Operations maintained by the application, starting at 1.
12    APPLICATION = 1i32,
13}
14impl MessageKind {
15    ///Idiomatic alias for [`Self::LIFECYCLE`]; `Debug` prints the variant name.
16    #[allow(non_upper_case_globals)]
17    pub const Lifecycle: Self = Self::LIFECYCLE;
18    ///Idiomatic alias for [`Self::APPLICATION`]; `Debug` prints the variant name.
19    #[allow(non_upper_case_globals)]
20    pub const Application: Self = Self::APPLICATION;
21}
22impl ::core::default::Default for MessageKind {
23    fn default() -> Self {
24        Self::LIFECYCLE
25    }
26}
27impl ::buffa::Enumeration for MessageKind {
28    fn from_i32(value: i32) -> ::core::option::Option<Self> {
29        match value {
30            0i32 => ::core::option::Option::Some(Self::LIFECYCLE),
31            1i32 => ::core::option::Option::Some(Self::APPLICATION),
32            _ => ::core::option::Option::None,
33        }
34    }
35    fn to_i32(&self) -> i32 {
36        *self as i32
37    }
38    fn proto_name(&self) -> &'static str {
39        match self {
40            Self::LIFECYCLE => "LIFECYCLE",
41            Self::APPLICATION => "APPLICATION",
42        }
43    }
44    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
45        match name {
46            "LIFECYCLE" => ::core::option::Option::Some(Self::LIFECYCLE),
47            "APPLICATION" => ::core::option::Option::Some(Self::APPLICATION),
48            _ => ::core::option::Option::None,
49        }
50    }
51    fn values() -> &'static [Self] {
52        &[Self::LIFECYCLE, Self::APPLICATION]
53    }
54}
55/// WATCH always starts with a snapshot. Updates carry the complete state too,
56/// so a slow observer can receive coalesced changes without losing current state.
57#[allow(non_camel_case_types)]
58#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
59#[repr(i32)]
60pub enum LifecycleChange {
61    SNAPSHOT = 0i32,
62    READY = 1i32,
63    DRAINING = 2i32,
64    SELECTION_CHANGED = 3i32,
65    RETIRING = 4i32,
66}
67impl LifecycleChange {
68    ///Idiomatic alias for [`Self::SNAPSHOT`]; `Debug` prints the variant name.
69    #[allow(non_upper_case_globals)]
70    pub const Snapshot: Self = Self::SNAPSHOT;
71    ///Idiomatic alias for [`Self::READY`]; `Debug` prints the variant name.
72    #[allow(non_upper_case_globals)]
73    pub const Ready: Self = Self::READY;
74    ///Idiomatic alias for [`Self::DRAINING`]; `Debug` prints the variant name.
75    #[allow(non_upper_case_globals)]
76    pub const Draining: Self = Self::DRAINING;
77    ///Idiomatic alias for [`Self::SELECTION_CHANGED`]; `Debug` prints the variant name.
78    #[allow(non_upper_case_globals)]
79    pub const SelectionChanged: Self = Self::SELECTION_CHANGED;
80    ///Idiomatic alias for [`Self::RETIRING`]; `Debug` prints the variant name.
81    #[allow(non_upper_case_globals)]
82    pub const Retiring: Self = Self::RETIRING;
83}
84impl ::core::default::Default for LifecycleChange {
85    fn default() -> Self {
86        Self::SNAPSHOT
87    }
88}
89impl ::buffa::Enumeration for LifecycleChange {
90    fn from_i32(value: i32) -> ::core::option::Option<Self> {
91        match value {
92            0i32 => ::core::option::Option::Some(Self::SNAPSHOT),
93            1i32 => ::core::option::Option::Some(Self::READY),
94            2i32 => ::core::option::Option::Some(Self::DRAINING),
95            3i32 => ::core::option::Option::Some(Self::SELECTION_CHANGED),
96            4i32 => ::core::option::Option::Some(Self::RETIRING),
97            _ => ::core::option::Option::None,
98        }
99    }
100    fn to_i32(&self) -> i32 {
101        *self as i32
102    }
103    fn proto_name(&self) -> &'static str {
104        match self {
105            Self::SNAPSHOT => "SNAPSHOT",
106            Self::READY => "READY",
107            Self::DRAINING => "DRAINING",
108            Self::SELECTION_CHANGED => "SELECTION_CHANGED",
109            Self::RETIRING => "RETIRING",
110        }
111    }
112    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
113        match name {
114            "SNAPSHOT" => ::core::option::Option::Some(Self::SNAPSHOT),
115            "READY" => ::core::option::Option::Some(Self::READY),
116            "DRAINING" => ::core::option::Option::Some(Self::DRAINING),
117            "SELECTION_CHANGED" => ::core::option::Option::Some(Self::SELECTION_CHANGED),
118            "RETIRING" => ::core::option::Option::Some(Self::RETIRING),
119            _ => ::core::option::Option::None,
120        }
121    }
122    fn values() -> &'static [Self] {
123        &[
124            Self::SNAPSHOT,
125            Self::READY,
126            Self::DRAINING,
127            Self::SELECTION_CHANGED,
128            Self::RETIRING,
129        ]
130    }
131}
132/// Why a server closes a connection during negotiation.
133#[allow(non_camel_case_types)]
134#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
135#[repr(i32)]
136pub enum Refusal {
137    /// Not a refusal; an offer leaves this unset.
138    NOT_REFUSED = 0i32,
139    /// The client lacks a binary version or capability the server requires.
140    PROTOCOL_TOO_OLD = 1i32,
141    /// The server's peer policy rejected this client.
142    PEER_REJECTED = 2i32,
143    /// The server is retiring. Read discovery again to find its successor.
144    SERVER_RETIRING = 3i32,
145}
146impl Refusal {
147    ///Idiomatic alias for [`Self::NOT_REFUSED`]; `Debug` prints the variant name.
148    #[allow(non_upper_case_globals)]
149    pub const NotRefused: Self = Self::NOT_REFUSED;
150    ///Idiomatic alias for [`Self::PROTOCOL_TOO_OLD`]; `Debug` prints the variant name.
151    #[allow(non_upper_case_globals)]
152    pub const ProtocolTooOld: Self = Self::PROTOCOL_TOO_OLD;
153    ///Idiomatic alias for [`Self::PEER_REJECTED`]; `Debug` prints the variant name.
154    #[allow(non_upper_case_globals)]
155    pub const PeerRejected: Self = Self::PEER_REJECTED;
156    ///Idiomatic alias for [`Self::SERVER_RETIRING`]; `Debug` prints the variant name.
157    #[allow(non_upper_case_globals)]
158    pub const ServerRetiring: Self = Self::SERVER_RETIRING;
159}
160impl ::core::default::Default for Refusal {
161    fn default() -> Self {
162        Self::NOT_REFUSED
163    }
164}
165impl ::buffa::Enumeration for Refusal {
166    fn from_i32(value: i32) -> ::core::option::Option<Self> {
167        match value {
168            0i32 => ::core::option::Option::Some(Self::NOT_REFUSED),
169            1i32 => ::core::option::Option::Some(Self::PROTOCOL_TOO_OLD),
170            2i32 => ::core::option::Option::Some(Self::PEER_REJECTED),
171            3i32 => ::core::option::Option::Some(Self::SERVER_RETIRING),
172            _ => ::core::option::Option::None,
173        }
174    }
175    fn to_i32(&self) -> i32 {
176        *self as i32
177    }
178    fn proto_name(&self) -> &'static str {
179        match self {
180            Self::NOT_REFUSED => "NOT_REFUSED",
181            Self::PROTOCOL_TOO_OLD => "PROTOCOL_TOO_OLD",
182            Self::PEER_REJECTED => "PEER_REJECTED",
183            Self::SERVER_RETIRING => "SERVER_RETIRING",
184        }
185    }
186    fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
187        match name {
188            "NOT_REFUSED" => ::core::option::Option::Some(Self::NOT_REFUSED),
189            "PROTOCOL_TOO_OLD" => ::core::option::Option::Some(Self::PROTOCOL_TOO_OLD),
190            "PEER_REJECTED" => ::core::option::Option::Some(Self::PEER_REJECTED),
191            "SERVER_RETIRING" => ::core::option::Option::Some(Self::SERVER_RETIRING),
192            _ => ::core::option::Option::None,
193        }
194    }
195    fn values() -> &'static [Self] {
196        &[
197            Self::NOT_REFUSED,
198            Self::PROTOCOL_TOO_OLD,
199            Self::PEER_REJECTED,
200            Self::SERVER_RETIRING,
201        ]
202    }
203}
204/// Version/capability offer. Field numbers are part of the wire contract.
205/// Never reuse a removed field number or change its type.
206#[derive(Clone, PartialEq, Default)]
207pub struct Hello {
208    /// Oldest binary version this peer can speak.
209    ///
210    /// Field 1: `minimum`
211    pub minimum: u32,
212    /// Newest binary version this peer can speak.
213    ///
214    /// Field 2: `maximum`
215    pub maximum: u32,
216    /// Implemented optional capabilities.
217    ///
218    /// Field 3: `supported`
219    pub supported: u64,
220    /// Capabilities without which this connection must be refused.
221    ///
222    /// Field 4: `required`
223    pub required: u64,
224    /// Maximum encoded frame this peer will receive.
225    ///
226    /// Field 5: `max_frame`
227    pub max_frame: u32,
228    /// Application protocol identifier; not an authentication credential.
229    ///
230    /// Field 6: `application`
231    pub application: ::buffa::alloc::string::String,
232    /// Installation profile, such as stable or dev. Must match the peer exactly.
233    ///
234    /// Field 7: `profile`
235    pub profile: ::buffa::alloc::string::String,
236    /// Named service instance. Must match the peer exactly.
237    ///
238    /// Field 8: `instance`
239    pub instance: ::buffa::alloc::string::String,
240    /// Package-owned UUID, exactly 16 bytes, non-nil and stable across upgrades.
241    /// This is an identity check, not an authentication credential.
242    ///
243    /// Field 9: `service_id`
244    pub service_id: ::buffa::alloc::vec::Vec<u8>,
245    /// This client reads a refusal in place of the server's offer. A server sends
246    /// one only when this is set; any other client sees the connection close.
247    ///
248    /// Field 10: `reads_refusal`
249    pub reads_refusal: bool,
250    /// Set only in a server's refusal, which carries no other field. The server
251    /// closes the connection after sending it.
252    ///
253    /// Field 11: `refusal`
254    pub refusal: ::buffa::EnumValue<Refusal>,
255    #[doc(hidden)]
256    pub __buffa_unknown_fields: ::buffa::UnknownFields,
257}
258impl ::core::fmt::Debug for Hello {
259    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
260        f.debug_struct("Hello")
261            .field("minimum", &self.minimum)
262            .field("maximum", &self.maximum)
263            .field("supported", &self.supported)
264            .field("required", &self.required)
265            .field("max_frame", &self.max_frame)
266            .field("application", &self.application)
267            .field("profile", &self.profile)
268            .field("instance", &self.instance)
269            .field("service_id", &self.service_id)
270            .field("reads_refusal", &self.reads_refusal)
271            .field("refusal", &self.refusal)
272            .finish()
273    }
274}
275impl Hello {
276    /// Protobuf type URL for this message, for use with `Any::pack` and
277    /// `Any::unpack_if`.
278    ///
279    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
280    pub const TYPE_URL: &'static str = "type.googleapis.com/kunobi.daemon.v2.Hello";
281}
282::buffa::impl_default_instance!(Hello);
283impl ::buffa::MessageName for Hello {
284    const PACKAGE: &'static str = "kunobi.daemon.v2";
285    const NAME: &'static str = "Hello";
286    const FULL_NAME: &'static str = "kunobi.daemon.v2.Hello";
287    const TYPE_URL: &'static str = "type.googleapis.com/kunobi.daemon.v2.Hello";
288}
289impl ::buffa::Message for Hello {
290    /// Returns the total encoded size in bytes.
291    ///
292    /// Accumulates in `u64` (which cannot overflow for in-memory
293    /// data) and saturates to `u32` at return, so a message whose
294    /// encoded size exceeds the 2 GiB protobuf limit yields a value
295    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
296    /// points reject, never a silently wrapped size.
297    #[allow(clippy::let_and_return)]
298    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
299        #[allow(unused_imports)]
300        use ::buffa::Enumeration as _;
301        let mut size = 0u64;
302        if self.minimum != 0u32 {
303            size += 1u64 + ::buffa::types::uint32_encoded_len(self.minimum) as u64;
304        }
305        if self.maximum != 0u32 {
306            size += 1u64 + ::buffa::types::uint32_encoded_len(self.maximum) as u64;
307        }
308        if self.supported != 0u64 {
309            size += 1u64 + ::buffa::types::uint64_encoded_len(self.supported) as u64;
310        }
311        if self.required != 0u64 {
312            size += 1u64 + ::buffa::types::uint64_encoded_len(self.required) as u64;
313        }
314        if self.max_frame != 0u32 {
315            size += 1u64 + ::buffa::types::uint32_encoded_len(self.max_frame) as u64;
316        }
317        if !self.application.is_empty() {
318            size += 1u64 + ::buffa::types::string_encoded_len(&self.application) as u64;
319        }
320        if !self.profile.is_empty() {
321            size += 1u64 + ::buffa::types::string_encoded_len(&self.profile) as u64;
322        }
323        if !self.instance.is_empty() {
324            size += 1u64 + ::buffa::types::string_encoded_len(&self.instance) as u64;
325        }
326        if !self.service_id.is_empty() {
327            size += 1u64 + ::buffa::types::bytes_encoded_len(&self.service_id) as u64;
328        }
329        if self.reads_refusal {
330            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
331        }
332        {
333            let val = self.refusal.to_i32();
334            if val != 0 {
335                size += 1u64 + ::buffa::types::int32_encoded_len(val) as u64;
336            }
337        }
338        size += self.__buffa_unknown_fields.encoded_len() as u64;
339        ::buffa::saturate_size(size)
340    }
341    fn write_to(
342        &self,
343        _cache: &mut ::buffa::SizeCache,
344        buf: &mut impl ::buffa::EncodeSink,
345    ) {
346        #[allow(unused_imports)]
347        use ::buffa::Enumeration as _;
348        if self.minimum != 0u32 {
349            ::buffa::types::put_uint32_field(1u32, self.minimum, buf);
350        }
351        if self.maximum != 0u32 {
352            ::buffa::types::put_uint32_field(2u32, self.maximum, buf);
353        }
354        if self.supported != 0u64 {
355            ::buffa::types::put_uint64_field(3u32, self.supported, buf);
356        }
357        if self.required != 0u64 {
358            ::buffa::types::put_uint64_field(4u32, self.required, buf);
359        }
360        if self.max_frame != 0u32 {
361            ::buffa::types::put_uint32_field(5u32, self.max_frame, buf);
362        }
363        if !self.application.is_empty() {
364            ::buffa::types::put_string_field(6u32, &self.application, buf);
365        }
366        if !self.profile.is_empty() {
367            ::buffa::types::put_string_field(7u32, &self.profile, buf);
368        }
369        if !self.instance.is_empty() {
370            ::buffa::types::put_string_field(8u32, &self.instance, buf);
371        }
372        if !self.service_id.is_empty() {
373            ::buffa::types::put_shared_bytes_field(9u32, &self.service_id, buf);
374        }
375        if self.reads_refusal {
376            ::buffa::types::put_bool_field(10u32, self.reads_refusal, buf);
377        }
378        {
379            let val = self.refusal.to_i32();
380            if val != 0 {
381                ::buffa::types::put_int32_field(11u32, val, buf);
382            }
383        }
384        self.__buffa_unknown_fields.write_to(buf);
385    }
386    fn merge_field(
387        &mut self,
388        tag: ::buffa::encoding::Tag,
389        buf: &mut impl ::buffa::bytes::Buf,
390        ctx: ::buffa::DecodeContext<'_>,
391    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
392        #[allow(unused_imports)]
393        use ::buffa::bytes::Buf as _;
394        #[allow(unused_imports)]
395        use ::buffa::Enumeration as _;
396        match tag.field_number() {
397            1u32 => {
398                ::buffa::encoding::check_wire_type(
399                    tag,
400                    ::buffa::encoding::WireType::Varint,
401                )?;
402                self.minimum = ::buffa::types::decode_uint32(buf)?;
403            }
404            2u32 => {
405                ::buffa::encoding::check_wire_type(
406                    tag,
407                    ::buffa::encoding::WireType::Varint,
408                )?;
409                self.maximum = ::buffa::types::decode_uint32(buf)?;
410            }
411            3u32 => {
412                ::buffa::encoding::check_wire_type(
413                    tag,
414                    ::buffa::encoding::WireType::Varint,
415                )?;
416                self.supported = ::buffa::types::decode_uint64(buf)?;
417            }
418            4u32 => {
419                ::buffa::encoding::check_wire_type(
420                    tag,
421                    ::buffa::encoding::WireType::Varint,
422                )?;
423                self.required = ::buffa::types::decode_uint64(buf)?;
424            }
425            5u32 => {
426                ::buffa::encoding::check_wire_type(
427                    tag,
428                    ::buffa::encoding::WireType::Varint,
429                )?;
430                self.max_frame = ::buffa::types::decode_uint32(buf)?;
431            }
432            6u32 => {
433                ::buffa::encoding::check_wire_type(
434                    tag,
435                    ::buffa::encoding::WireType::LengthDelimited,
436                )?;
437                ::buffa::types::merge_string(&mut self.application, buf)?;
438            }
439            7u32 => {
440                ::buffa::encoding::check_wire_type(
441                    tag,
442                    ::buffa::encoding::WireType::LengthDelimited,
443                )?;
444                ::buffa::types::merge_string(&mut self.profile, buf)?;
445            }
446            8u32 => {
447                ::buffa::encoding::check_wire_type(
448                    tag,
449                    ::buffa::encoding::WireType::LengthDelimited,
450                )?;
451                ::buffa::types::merge_string(&mut self.instance, buf)?;
452            }
453            9u32 => {
454                ::buffa::encoding::check_wire_type(
455                    tag,
456                    ::buffa::encoding::WireType::LengthDelimited,
457                )?;
458                ::buffa::types::merge_bytes(&mut self.service_id, buf)?;
459            }
460            10u32 => {
461                ::buffa::encoding::check_wire_type(
462                    tag,
463                    ::buffa::encoding::WireType::Varint,
464                )?;
465                self.reads_refusal = ::buffa::types::decode_bool(buf)?;
466            }
467            11u32 => {
468                ::buffa::encoding::check_wire_type(
469                    tag,
470                    ::buffa::encoding::WireType::Varint,
471                )?;
472                self.refusal = ::buffa::EnumValue::from(
473                    ::buffa::types::decode_int32(buf)?,
474                );
475            }
476            _ => {
477                self.__buffa_unknown_fields
478                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
479            }
480        }
481        ::core::result::Result::Ok(())
482    }
483    fn clear(&mut self) {
484        self.minimum = 0u32;
485        self.maximum = 0u32;
486        self.supported = 0u64;
487        self.required = 0u64;
488        self.max_frame = 0u32;
489        self.application.clear();
490        self.profile.clear();
491        self.instance.clear();
492        self.service_id.clear();
493        self.reads_refusal = false;
494        self.refusal = ::buffa::EnumValue::from(0);
495        self.__buffa_unknown_fields.clear();
496    }
497}
498impl ::buffa::ExtensionSet for Hello {
499    const PROTO_FQN: &'static str = "kunobi.daemon.v2.Hello";
500    fn unknown_fields(&self) -> &::buffa::UnknownFields {
501        &self.__buffa_unknown_fields
502    }
503    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
504        &mut self.__buffa_unknown_fields
505    }
506}
507/// Common lifecycle control fields. Unknown fields are not interpreted by the Rust
508/// receiver and retained when re-encoding. New semantics require capabilities.
509#[derive(Clone, PartialEq, Default)]
510pub struct Control {
511    /// Operation: health=1, drain=2, prepare=3, paused=4, ready=5, commit=6, abort=7, watch=8.
512    /// For kind=APPLICATION, the application owns IDs starting at 1 instead.
513    /// Never reuse retired operation IDs within either kind.
514    ///
515    /// Field 1: `operation`
516    pub operation: u32,
517    /// Caller-supplied correlation ID; never used to automatically replay work.
518    ///
519    /// Field 2: `request_id`
520    pub request_id: u64,
521    /// Destination generation, where applicable.
522    ///
523    /// Field 3: `generation`
524    pub generation: u64,
525    /// Attempt identity. The handoff coordinator validates its meaning.
526    ///
527    /// Field 4: `token`
528    pub token: ::buffa::alloc::vec::Vec<u8>,
529    /// Byte boundary acknowledged by the handoff peer. Absent differs from zero.
530    ///
531    /// Field 5: `offset`
532    pub offset: ::core::option::Option<u64>,
533    /// Bounded application data; large streams must be chunked.
534    ///
535    /// Field 6: `payload`
536    pub payload: ::buffa::alloc::vec::Vec<u8>,
537    /// Selects the operation namespace. Unknown kinds must be rejected.
538    ///
539    /// Field 7: `kind`
540    pub kind: ::buffa::EnumValue<MessageKind>,
541    #[doc(hidden)]
542    pub __buffa_unknown_fields: ::buffa::UnknownFields,
543}
544impl ::core::fmt::Debug for Control {
545    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
546        f.debug_struct("Control")
547            .field("operation", &self.operation)
548            .field("request_id", &self.request_id)
549            .field("generation", &self.generation)
550            .field("token", &self.token)
551            .field("offset", &self.offset)
552            .field("payload", &self.payload)
553            .field("kind", &self.kind)
554            .finish()
555    }
556}
557impl Control {
558    /// Protobuf type URL for this message, for use with `Any::pack` and
559    /// `Any::unpack_if`.
560    ///
561    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
562    pub const TYPE_URL: &'static str = "type.googleapis.com/kunobi.daemon.v2.Control";
563}
564impl Control {
565    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
566    #[inline]
567    ///Sets [`Self::offset`] to `Some(value)`, consuming and returning `self`.
568    pub fn with_offset(mut self, value: u64) -> Self {
569        self.offset = Some(value);
570        self
571    }
572}
573::buffa::impl_default_instance!(Control);
574impl ::buffa::MessageName for Control {
575    const PACKAGE: &'static str = "kunobi.daemon.v2";
576    const NAME: &'static str = "Control";
577    const FULL_NAME: &'static str = "kunobi.daemon.v2.Control";
578    const TYPE_URL: &'static str = "type.googleapis.com/kunobi.daemon.v2.Control";
579}
580impl ::buffa::Message for Control {
581    /// Returns the total encoded size in bytes.
582    ///
583    /// Accumulates in `u64` (which cannot overflow for in-memory
584    /// data) and saturates to `u32` at return, so a message whose
585    /// encoded size exceeds the 2 GiB protobuf limit yields a value
586    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
587    /// points reject, never a silently wrapped size.
588    #[allow(clippy::let_and_return)]
589    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
590        #[allow(unused_imports)]
591        use ::buffa::Enumeration as _;
592        let mut size = 0u64;
593        if self.operation != 0u32 {
594            size += 1u64 + ::buffa::types::uint32_encoded_len(self.operation) as u64;
595        }
596        if self.request_id != 0u64 {
597            size += 1u64 + ::buffa::types::uint64_encoded_len(self.request_id) as u64;
598        }
599        if self.generation != 0u64 {
600            size += 1u64 + ::buffa::types::uint64_encoded_len(self.generation) as u64;
601        }
602        if !self.token.is_empty() {
603            size += 1u64 + ::buffa::types::bytes_encoded_len(&self.token) as u64;
604        }
605        if let Some(v) = self.offset {
606            size += 1u64 + ::buffa::types::uint64_encoded_len(v) as u64;
607        }
608        if !self.payload.is_empty() {
609            size += 1u64 + ::buffa::types::bytes_encoded_len(&self.payload) as u64;
610        }
611        {
612            let val = self.kind.to_i32();
613            if val != 0 {
614                size += 1u64 + ::buffa::types::int32_encoded_len(val) as u64;
615            }
616        }
617        size += self.__buffa_unknown_fields.encoded_len() as u64;
618        ::buffa::saturate_size(size)
619    }
620    fn write_to(
621        &self,
622        _cache: &mut ::buffa::SizeCache,
623        buf: &mut impl ::buffa::EncodeSink,
624    ) {
625        #[allow(unused_imports)]
626        use ::buffa::Enumeration as _;
627        if self.operation != 0u32 {
628            ::buffa::types::put_uint32_field(1u32, self.operation, buf);
629        }
630        if self.request_id != 0u64 {
631            ::buffa::types::put_uint64_field(2u32, self.request_id, buf);
632        }
633        if self.generation != 0u64 {
634            ::buffa::types::put_uint64_field(3u32, self.generation, buf);
635        }
636        if !self.token.is_empty() {
637            ::buffa::types::put_shared_bytes_field(4u32, &self.token, buf);
638        }
639        if let Some(v) = self.offset {
640            ::buffa::types::put_uint64_field(5u32, v, buf);
641        }
642        if !self.payload.is_empty() {
643            ::buffa::types::put_shared_bytes_field(6u32, &self.payload, buf);
644        }
645        {
646            let val = self.kind.to_i32();
647            if val != 0 {
648                ::buffa::types::put_int32_field(7u32, val, buf);
649            }
650        }
651        self.__buffa_unknown_fields.write_to(buf);
652    }
653    fn merge_field(
654        &mut self,
655        tag: ::buffa::encoding::Tag,
656        buf: &mut impl ::buffa::bytes::Buf,
657        ctx: ::buffa::DecodeContext<'_>,
658    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
659        #[allow(unused_imports)]
660        use ::buffa::bytes::Buf as _;
661        #[allow(unused_imports)]
662        use ::buffa::Enumeration as _;
663        match tag.field_number() {
664            1u32 => {
665                ::buffa::encoding::check_wire_type(
666                    tag,
667                    ::buffa::encoding::WireType::Varint,
668                )?;
669                self.operation = ::buffa::types::decode_uint32(buf)?;
670            }
671            2u32 => {
672                ::buffa::encoding::check_wire_type(
673                    tag,
674                    ::buffa::encoding::WireType::Varint,
675                )?;
676                self.request_id = ::buffa::types::decode_uint64(buf)?;
677            }
678            3u32 => {
679                ::buffa::encoding::check_wire_type(
680                    tag,
681                    ::buffa::encoding::WireType::Varint,
682                )?;
683                self.generation = ::buffa::types::decode_uint64(buf)?;
684            }
685            4u32 => {
686                ::buffa::encoding::check_wire_type(
687                    tag,
688                    ::buffa::encoding::WireType::LengthDelimited,
689                )?;
690                ::buffa::types::merge_bytes(&mut self.token, buf)?;
691            }
692            5u32 => {
693                ::buffa::encoding::check_wire_type(
694                    tag,
695                    ::buffa::encoding::WireType::Varint,
696                )?;
697                self.offset = ::core::option::Option::Some(
698                    ::buffa::types::decode_uint64(buf)?,
699                );
700            }
701            6u32 => {
702                ::buffa::encoding::check_wire_type(
703                    tag,
704                    ::buffa::encoding::WireType::LengthDelimited,
705                )?;
706                ::buffa::types::merge_bytes(&mut self.payload, buf)?;
707            }
708            7u32 => {
709                ::buffa::encoding::check_wire_type(
710                    tag,
711                    ::buffa::encoding::WireType::Varint,
712                )?;
713                self.kind = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
714            }
715            _ => {
716                self.__buffa_unknown_fields
717                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
718            }
719        }
720        ::core::result::Result::Ok(())
721    }
722    fn clear(&mut self) {
723        self.operation = 0u32;
724        self.request_id = 0u64;
725        self.generation = 0u64;
726        self.token.clear();
727        self.offset = ::core::option::Option::None;
728        self.payload.clear();
729        self.kind = ::buffa::EnumValue::from(0);
730        self.__buffa_unknown_fields.clear();
731    }
732}
733impl ::buffa::ExtensionSet for Control {
734    const PROTO_FQN: &'static str = "kunobi.daemon.v2.Control";
735    fn unknown_fields(&self) -> &::buffa::UnknownFields {
736        &self.__buffa_unknown_fields
737    }
738    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
739        &mut self.__buffa_unknown_fields
740    }
741}
742/// Payload of HEALTH and DRAIN replies when HEALTH_DETAILS is negotiated.
743/// This observation is made in memory, independently of application I/O.
744#[derive(Clone, PartialEq, Default)]
745pub struct Health {
746    /// Field 1: `process_id`
747    pub process_id: u32,
748    /// Field 2: `generation`
749    pub generation: u64,
750    /// Field 3: `build`
751    pub build: ::buffa::alloc::string::String,
752    /// Application-defined monotonically comparable build revision, if used.
753    ///
754    /// Field 4: `revision`
755    pub revision: u64,
756    /// Field 5: `ready`
757    pub ready: bool,
758    /// Field 6: `draining`
759    pub draining: bool,
760    /// Field 7: `active`
761    pub active: u64,
762    #[doc(hidden)]
763    pub __buffa_unknown_fields: ::buffa::UnknownFields,
764}
765impl ::core::fmt::Debug for Health {
766    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
767        f.debug_struct("Health")
768            .field("process_id", &self.process_id)
769            .field("generation", &self.generation)
770            .field("build", &self.build)
771            .field("revision", &self.revision)
772            .field("ready", &self.ready)
773            .field("draining", &self.draining)
774            .field("active", &self.active)
775            .finish()
776    }
777}
778impl Health {
779    /// Protobuf type URL for this message, for use with `Any::pack` and
780    /// `Any::unpack_if`.
781    ///
782    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
783    pub const TYPE_URL: &'static str = "type.googleapis.com/kunobi.daemon.v2.Health";
784}
785::buffa::impl_default_instance!(Health);
786impl ::buffa::MessageName for Health {
787    const PACKAGE: &'static str = "kunobi.daemon.v2";
788    const NAME: &'static str = "Health";
789    const FULL_NAME: &'static str = "kunobi.daemon.v2.Health";
790    const TYPE_URL: &'static str = "type.googleapis.com/kunobi.daemon.v2.Health";
791}
792impl ::buffa::Message for Health {
793    /// Returns the total encoded size in bytes.
794    ///
795    /// Accumulates in `u64` (which cannot overflow for in-memory
796    /// data) and saturates to `u32` at return, so a message whose
797    /// encoded size exceeds the 2 GiB protobuf limit yields a value
798    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
799    /// points reject, never a silently wrapped size.
800    #[allow(clippy::let_and_return)]
801    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
802        #[allow(unused_imports)]
803        use ::buffa::Enumeration as _;
804        let mut size = 0u64;
805        if self.process_id != 0u32 {
806            size += 1u64 + ::buffa::types::uint32_encoded_len(self.process_id) as u64;
807        }
808        if self.generation != 0u64 {
809            size += 1u64 + ::buffa::types::uint64_encoded_len(self.generation) as u64;
810        }
811        if !self.build.is_empty() {
812            size += 1u64 + ::buffa::types::string_encoded_len(&self.build) as u64;
813        }
814        if self.revision != 0u64 {
815            size += 1u64 + ::buffa::types::uint64_encoded_len(self.revision) as u64;
816        }
817        if self.ready {
818            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
819        }
820        if self.draining {
821            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
822        }
823        if self.active != 0u64 {
824            size += 1u64 + ::buffa::types::uint64_encoded_len(self.active) as u64;
825        }
826        size += self.__buffa_unknown_fields.encoded_len() as u64;
827        ::buffa::saturate_size(size)
828    }
829    fn write_to(
830        &self,
831        _cache: &mut ::buffa::SizeCache,
832        buf: &mut impl ::buffa::EncodeSink,
833    ) {
834        #[allow(unused_imports)]
835        use ::buffa::Enumeration as _;
836        if self.process_id != 0u32 {
837            ::buffa::types::put_uint32_field(1u32, self.process_id, buf);
838        }
839        if self.generation != 0u64 {
840            ::buffa::types::put_uint64_field(2u32, self.generation, buf);
841        }
842        if !self.build.is_empty() {
843            ::buffa::types::put_string_field(3u32, &self.build, buf);
844        }
845        if self.revision != 0u64 {
846            ::buffa::types::put_uint64_field(4u32, self.revision, buf);
847        }
848        if self.ready {
849            ::buffa::types::put_bool_field(5u32, self.ready, buf);
850        }
851        if self.draining {
852            ::buffa::types::put_bool_field(6u32, self.draining, buf);
853        }
854        if self.active != 0u64 {
855            ::buffa::types::put_uint64_field(7u32, self.active, buf);
856        }
857        self.__buffa_unknown_fields.write_to(buf);
858    }
859    fn merge_field(
860        &mut self,
861        tag: ::buffa::encoding::Tag,
862        buf: &mut impl ::buffa::bytes::Buf,
863        ctx: ::buffa::DecodeContext<'_>,
864    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
865        #[allow(unused_imports)]
866        use ::buffa::bytes::Buf as _;
867        #[allow(unused_imports)]
868        use ::buffa::Enumeration as _;
869        match tag.field_number() {
870            1u32 => {
871                ::buffa::encoding::check_wire_type(
872                    tag,
873                    ::buffa::encoding::WireType::Varint,
874                )?;
875                self.process_id = ::buffa::types::decode_uint32(buf)?;
876            }
877            2u32 => {
878                ::buffa::encoding::check_wire_type(
879                    tag,
880                    ::buffa::encoding::WireType::Varint,
881                )?;
882                self.generation = ::buffa::types::decode_uint64(buf)?;
883            }
884            3u32 => {
885                ::buffa::encoding::check_wire_type(
886                    tag,
887                    ::buffa::encoding::WireType::LengthDelimited,
888                )?;
889                ::buffa::types::merge_string(&mut self.build, buf)?;
890            }
891            4u32 => {
892                ::buffa::encoding::check_wire_type(
893                    tag,
894                    ::buffa::encoding::WireType::Varint,
895                )?;
896                self.revision = ::buffa::types::decode_uint64(buf)?;
897            }
898            5u32 => {
899                ::buffa::encoding::check_wire_type(
900                    tag,
901                    ::buffa::encoding::WireType::Varint,
902                )?;
903                self.ready = ::buffa::types::decode_bool(buf)?;
904            }
905            6u32 => {
906                ::buffa::encoding::check_wire_type(
907                    tag,
908                    ::buffa::encoding::WireType::Varint,
909                )?;
910                self.draining = ::buffa::types::decode_bool(buf)?;
911            }
912            7u32 => {
913                ::buffa::encoding::check_wire_type(
914                    tag,
915                    ::buffa::encoding::WireType::Varint,
916                )?;
917                self.active = ::buffa::types::decode_uint64(buf)?;
918            }
919            _ => {
920                self.__buffa_unknown_fields
921                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
922            }
923        }
924        ::core::result::Result::Ok(())
925    }
926    fn clear(&mut self) {
927        self.process_id = 0u32;
928        self.generation = 0u64;
929        self.build.clear();
930        self.revision = 0u64;
931        self.ready = false;
932        self.draining = false;
933        self.active = 0u64;
934        self.__buffa_unknown_fields.clear();
935    }
936}
937impl ::buffa::ExtensionSet for Health {
938    const PROTO_FQN: &'static str = "kunobi.daemon.v2.Health";
939    fn unknown_fields(&self) -> &::buffa::UnknownFields {
940        &self.__buffa_unknown_fields
941    }
942    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
943        &mut self.__buffa_unknown_fields
944    }
945}
946#[derive(Clone, PartialEq, Default)]
947pub struct LifecycleEvent {
948    /// Field 1: `change`
949    pub change: ::buffa::EnumValue<LifecycleChange>,
950    /// Increasing within this subscription, starting at one.
951    ///
952    /// Field 2: `sequence`
953    pub sequence: u64,
954    /// Field 3: `process_id`
955    pub process_id: u32,
956    /// Field 4: `generation`
957    pub generation: u64,
958    /// Field 5: `build`
959    pub build: ::buffa::alloc::string::String,
960    /// Field 6: `ready`
961    pub ready: bool,
962    /// Field 7: `draining`
963    pub draining: bool,
964    /// Most recently committed selection, which may name a successor.
965    ///
966    /// Field 8: `selected_generation`
967    pub selected_generation: ::core::option::Option<u64>,
968    /// Field 9: `selected_build`
969    pub selected_build: ::buffa::alloc::string::String,
970    /// Field 10: `retiring`
971    pub retiring: bool,
972    #[doc(hidden)]
973    pub __buffa_unknown_fields: ::buffa::UnknownFields,
974}
975impl ::core::fmt::Debug for LifecycleEvent {
976    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
977        f.debug_struct("LifecycleEvent")
978            .field("change", &self.change)
979            .field("sequence", &self.sequence)
980            .field("process_id", &self.process_id)
981            .field("generation", &self.generation)
982            .field("build", &self.build)
983            .field("ready", &self.ready)
984            .field("draining", &self.draining)
985            .field("selected_generation", &self.selected_generation)
986            .field("selected_build", &self.selected_build)
987            .field("retiring", &self.retiring)
988            .finish()
989    }
990}
991impl LifecycleEvent {
992    /// Protobuf type URL for this message, for use with `Any::pack` and
993    /// `Any::unpack_if`.
994    ///
995    /// Format: `type.googleapis.com/<fully.qualified.TypeName>`
996    pub const TYPE_URL: &'static str = "type.googleapis.com/kunobi.daemon.v2.LifecycleEvent";
997}
998impl LifecycleEvent {
999    #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1000    #[inline]
1001    ///Sets [`Self::selected_generation`] to `Some(value)`, consuming and returning `self`.
1002    pub fn with_selected_generation(mut self, value: u64) -> Self {
1003        self.selected_generation = Some(value);
1004        self
1005    }
1006}
1007::buffa::impl_default_instance!(LifecycleEvent);
1008impl ::buffa::MessageName for LifecycleEvent {
1009    const PACKAGE: &'static str = "kunobi.daemon.v2";
1010    const NAME: &'static str = "LifecycleEvent";
1011    const FULL_NAME: &'static str = "kunobi.daemon.v2.LifecycleEvent";
1012    const TYPE_URL: &'static str = "type.googleapis.com/kunobi.daemon.v2.LifecycleEvent";
1013}
1014impl ::buffa::Message for LifecycleEvent {
1015    /// Returns the total encoded size in bytes.
1016    ///
1017    /// Accumulates in `u64` (which cannot overflow for in-memory
1018    /// data) and saturates to `u32` at return, so a message whose
1019    /// encoded size exceeds the 2 GiB protobuf limit yields a value
1020    /// above [`::buffa::MAX_MESSAGE_BYTES`] that the encode entry
1021    /// points reject, never a silently wrapped size.
1022    #[allow(clippy::let_and_return)]
1023    fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1024        #[allow(unused_imports)]
1025        use ::buffa::Enumeration as _;
1026        let mut size = 0u64;
1027        {
1028            let val = self.change.to_i32();
1029            if val != 0 {
1030                size += 1u64 + ::buffa::types::int32_encoded_len(val) as u64;
1031            }
1032        }
1033        if self.sequence != 0u64 {
1034            size += 1u64 + ::buffa::types::uint64_encoded_len(self.sequence) as u64;
1035        }
1036        if self.process_id != 0u32 {
1037            size += 1u64 + ::buffa::types::uint32_encoded_len(self.process_id) as u64;
1038        }
1039        if self.generation != 0u64 {
1040            size += 1u64 + ::buffa::types::uint64_encoded_len(self.generation) as u64;
1041        }
1042        if !self.build.is_empty() {
1043            size += 1u64 + ::buffa::types::string_encoded_len(&self.build) as u64;
1044        }
1045        if self.ready {
1046            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
1047        }
1048        if self.draining {
1049            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
1050        }
1051        if let Some(v) = self.selected_generation {
1052            size += 1u64 + ::buffa::types::uint64_encoded_len(v) as u64;
1053        }
1054        if !self.selected_build.is_empty() {
1055            size
1056                += 1u64
1057                    + ::buffa::types::string_encoded_len(&self.selected_build) as u64;
1058        }
1059        if self.retiring {
1060            size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
1061        }
1062        size += self.__buffa_unknown_fields.encoded_len() as u64;
1063        ::buffa::saturate_size(size)
1064    }
1065    fn write_to(
1066        &self,
1067        _cache: &mut ::buffa::SizeCache,
1068        buf: &mut impl ::buffa::EncodeSink,
1069    ) {
1070        #[allow(unused_imports)]
1071        use ::buffa::Enumeration as _;
1072        {
1073            let val = self.change.to_i32();
1074            if val != 0 {
1075                ::buffa::types::put_int32_field(1u32, val, buf);
1076            }
1077        }
1078        if self.sequence != 0u64 {
1079            ::buffa::types::put_uint64_field(2u32, self.sequence, buf);
1080        }
1081        if self.process_id != 0u32 {
1082            ::buffa::types::put_uint32_field(3u32, self.process_id, buf);
1083        }
1084        if self.generation != 0u64 {
1085            ::buffa::types::put_uint64_field(4u32, self.generation, buf);
1086        }
1087        if !self.build.is_empty() {
1088            ::buffa::types::put_string_field(5u32, &self.build, buf);
1089        }
1090        if self.ready {
1091            ::buffa::types::put_bool_field(6u32, self.ready, buf);
1092        }
1093        if self.draining {
1094            ::buffa::types::put_bool_field(7u32, self.draining, buf);
1095        }
1096        if let Some(v) = self.selected_generation {
1097            ::buffa::types::put_uint64_field(8u32, v, buf);
1098        }
1099        if !self.selected_build.is_empty() {
1100            ::buffa::types::put_string_field(9u32, &self.selected_build, buf);
1101        }
1102        if self.retiring {
1103            ::buffa::types::put_bool_field(10u32, self.retiring, buf);
1104        }
1105        self.__buffa_unknown_fields.write_to(buf);
1106    }
1107    fn merge_field(
1108        &mut self,
1109        tag: ::buffa::encoding::Tag,
1110        buf: &mut impl ::buffa::bytes::Buf,
1111        ctx: ::buffa::DecodeContext<'_>,
1112    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1113        #[allow(unused_imports)]
1114        use ::buffa::bytes::Buf as _;
1115        #[allow(unused_imports)]
1116        use ::buffa::Enumeration as _;
1117        match tag.field_number() {
1118            1u32 => {
1119                ::buffa::encoding::check_wire_type(
1120                    tag,
1121                    ::buffa::encoding::WireType::Varint,
1122                )?;
1123                self.change = ::buffa::EnumValue::from(
1124                    ::buffa::types::decode_int32(buf)?,
1125                );
1126            }
1127            2u32 => {
1128                ::buffa::encoding::check_wire_type(
1129                    tag,
1130                    ::buffa::encoding::WireType::Varint,
1131                )?;
1132                self.sequence = ::buffa::types::decode_uint64(buf)?;
1133            }
1134            3u32 => {
1135                ::buffa::encoding::check_wire_type(
1136                    tag,
1137                    ::buffa::encoding::WireType::Varint,
1138                )?;
1139                self.process_id = ::buffa::types::decode_uint32(buf)?;
1140            }
1141            4u32 => {
1142                ::buffa::encoding::check_wire_type(
1143                    tag,
1144                    ::buffa::encoding::WireType::Varint,
1145                )?;
1146                self.generation = ::buffa::types::decode_uint64(buf)?;
1147            }
1148            5u32 => {
1149                ::buffa::encoding::check_wire_type(
1150                    tag,
1151                    ::buffa::encoding::WireType::LengthDelimited,
1152                )?;
1153                ::buffa::types::merge_string(&mut self.build, buf)?;
1154            }
1155            6u32 => {
1156                ::buffa::encoding::check_wire_type(
1157                    tag,
1158                    ::buffa::encoding::WireType::Varint,
1159                )?;
1160                self.ready = ::buffa::types::decode_bool(buf)?;
1161            }
1162            7u32 => {
1163                ::buffa::encoding::check_wire_type(
1164                    tag,
1165                    ::buffa::encoding::WireType::Varint,
1166                )?;
1167                self.draining = ::buffa::types::decode_bool(buf)?;
1168            }
1169            8u32 => {
1170                ::buffa::encoding::check_wire_type(
1171                    tag,
1172                    ::buffa::encoding::WireType::Varint,
1173                )?;
1174                self.selected_generation = ::core::option::Option::Some(
1175                    ::buffa::types::decode_uint64(buf)?,
1176                );
1177            }
1178            9u32 => {
1179                ::buffa::encoding::check_wire_type(
1180                    tag,
1181                    ::buffa::encoding::WireType::LengthDelimited,
1182                )?;
1183                ::buffa::types::merge_string(&mut self.selected_build, buf)?;
1184            }
1185            10u32 => {
1186                ::buffa::encoding::check_wire_type(
1187                    tag,
1188                    ::buffa::encoding::WireType::Varint,
1189                )?;
1190                self.retiring = ::buffa::types::decode_bool(buf)?;
1191            }
1192            _ => {
1193                self.__buffa_unknown_fields
1194                    .push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
1195            }
1196        }
1197        ::core::result::Result::Ok(())
1198    }
1199    fn clear(&mut self) {
1200        self.change = ::buffa::EnumValue::from(0);
1201        self.sequence = 0u64;
1202        self.process_id = 0u32;
1203        self.generation = 0u64;
1204        self.build.clear();
1205        self.ready = false;
1206        self.draining = false;
1207        self.selected_generation = ::core::option::Option::None;
1208        self.selected_build.clear();
1209        self.retiring = false;
1210        self.__buffa_unknown_fields.clear();
1211    }
1212}
1213impl ::buffa::ExtensionSet for LifecycleEvent {
1214    const PROTO_FQN: &'static str = "kunobi.daemon.v2.LifecycleEvent";
1215    fn unknown_fields(&self) -> &::buffa::UnknownFields {
1216        &self.__buffa_unknown_fields
1217    }
1218    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1219        &mut self.__buffa_unknown_fields
1220    }
1221}