exoware-sdk 2026.4.1

Interact with the Exoware API in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
// @generated by protoc-gen-buffa. DO NOT EDIT.
// source: store/v1/ingest.proto

/// Batch write request. All pairs are applied atomically.
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct PutRequest {
    /// Key-value pairs to write. At least one pair is required.
    ///
    /// Field 1: `kvs`
    #[serde(
        rename = "kvs",
        skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
        deserialize_with = "::buffa::json_helpers::null_as_default"
    )]
    pub kvs: ::buffa::alloc::vec::Vec<super::super::common::v1::KvEntry>,
    #[serde(skip)]
    #[doc(hidden)]
    pub __buffa_unknown_fields: ::buffa::UnknownFields,
    #[doc(hidden)]
    #[serde(skip)]
    pub __buffa_cached_size: ::buffa::__private::CachedSize,
}
impl ::core::fmt::Debug for PutRequest {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("PutRequest").field("kvs", &self.kvs).finish()
    }
}
impl PutRequest {
    /// 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/store.ingest.v1.PutRequest";
}
unsafe impl ::buffa::DefaultInstance for PutRequest {
    fn default_instance() -> &'static Self {
        static VALUE: ::buffa::__private::OnceBox<PutRequest> = ::buffa::__private::OnceBox::new();
        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
    }
}
impl ::buffa::Message for PutRequest {
    /// 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.
    fn compute_size(&self) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        for v in &self.kvs {
            let inner_size = v.compute_size();
            size
                += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
                    + inner_size;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        self.__buffa_cached_size.set(size);
        size
    }
    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        for v in &self.kvs {
            ::buffa::encoding::Tag::new(
                    1u32,
                    ::buffa::encoding::WireType::LengthDelimited,
                )
                .encode(buf);
            ::buffa::encoding::encode_varint(v.cached_size() as u64, buf);
            v.write_to(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.kvs.push(elem);
            }
            _ => {
                self.__buffa_unknown_fields
                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
            }
        }
        ::core::result::Result::Ok(())
    }
    fn cached_size(&self) -> u32 {
        self.__buffa_cached_size.get()
    }
    fn clear(&mut self) {
        self.kvs.clear();
        self.__buffa_unknown_fields.clear();
        self.__buffa_cached_size.set(0);
    }
}
impl ::buffa::ExtensionSet for PutRequest {
    const PROTO_FQN: &'static str = "store.ingest.v1.PutRequest";
    fn unknown_fields(&self) -> &::buffa::UnknownFields {
        &self.__buffa_unknown_fields
    }
    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
        &mut self.__buffa_unknown_fields
    }
}
impl ::buffa::json_helpers::ProtoElemJson for PutRequest {
    fn serialize_proto_json<S: ::serde::Serializer>(
        v: &Self,
        s: S,
    ) -> ::core::result::Result<S::Ok, S::Error> {
        ::serde::Serialize::serialize(v, s)
    }
    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
        d: D,
    ) -> ::core::result::Result<Self, D::Error> {
        <Self as ::serde::Deserialize>::deserialize(d)
    }
}
#[doc(hidden)]
pub const __PUT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
    type_url: "type.googleapis.com/store.ingest.v1.PutRequest",
    to_json: ::buffa::type_registry::any_to_json::<PutRequest>,
    from_json: ::buffa::type_registry::any_from_json::<PutRequest>,
    is_wkt: false,
};
/// Batch write request. All pairs are applied atomically.
#[derive(Clone, Debug, Default)]
pub struct PutRequestView<'a> {
    /// Key-value pairs to write. At least one pair is required.
    ///
    /// Field 1: `kvs`
    pub kvs: ::buffa::RepeatedView<'a, super::super::common::v1::KvEntryView<'a>>,
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> PutRequestView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            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 depth == 0 {
                        return Err(::buffa::DecodeError::RecursionLimitExceeded);
                    }
                    let sub = ::buffa::types::borrow_bytes(&mut cur)?;
                    view.kvs
                        .push(
                            super::super::common::v1::KvEntryView::_decode_depth(
                                sub,
                                depth - 1,
                            )?,
                        );
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for PutRequestView<'a> {
    type Owned = PutRequest;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    /// Convert this view to the owned message type.
    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
    fn to_owned_message(&self) -> PutRequest {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        PutRequest {
            kvs: self.kvs.iter().map(|v| v.to_owned_message()).collect(),
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
unsafe impl ::buffa::DefaultViewInstance for PutRequestView<'static> {
    fn default_view_instance() -> &'static Self {
        static VALUE: ::buffa::__private::OnceBox<PutRequestView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
    }
}
unsafe impl<'a> ::buffa::HasDefaultViewInstance for PutRequestView<'a> {
    type Static = PutRequestView<'static>;
}
/// Response from a successful Put.
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct PutResponse {
    /// Monotonically increasing store sequence number assigned to this write
    /// batch. Pass to query RPCs as `min_sequence_number` to ensure subsequent
    /// reads reflect this write.
    ///
    /// Field 1: `sequence_number`
    #[serde(
        rename = "sequenceNumber",
        alias = "sequence_number",
        with = "::buffa::json_helpers::uint64",
        skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
    )]
    pub sequence_number: u64,
    #[serde(skip)]
    #[doc(hidden)]
    pub __buffa_unknown_fields: ::buffa::UnknownFields,
    #[doc(hidden)]
    #[serde(skip)]
    pub __buffa_cached_size: ::buffa::__private::CachedSize,
}
impl ::core::fmt::Debug for PutResponse {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        f.debug_struct("PutResponse")
            .field("sequence_number", &self.sequence_number)
            .finish()
    }
}
impl PutResponse {
    /// 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/store.ingest.v1.PutResponse";
}
unsafe impl ::buffa::DefaultInstance for PutResponse {
    fn default_instance() -> &'static Self {
        static VALUE: ::buffa::__private::OnceBox<PutResponse> = ::buffa::__private::OnceBox::new();
        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
    }
}
impl ::buffa::Message for PutResponse {
    /// 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.
    fn compute_size(&self) -> u32 {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        let mut size = 0u32;
        if self.sequence_number != 0u64 {
            size
                += 1u32
                    + ::buffa::types::uint64_encoded_len(self.sequence_number) as u32;
        }
        size += self.__buffa_unknown_fields.encoded_len() as u32;
        self.__buffa_cached_size.set(size);
        size
    }
    fn write_to(&self, buf: &mut impl ::buffa::bytes::BufMut) {
        #[allow(unused_imports)]
        use ::buffa::Enumeration as _;
        if self.sequence_number != 0u64 {
            ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
                .encode(buf);
            ::buffa::types::encode_uint64(self.sequence_number, 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.sequence_number = ::buffa::types::decode_uint64(buf)?;
            }
            _ => {
                self.__buffa_unknown_fields
                    .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
            }
        }
        ::core::result::Result::Ok(())
    }
    fn cached_size(&self) -> u32 {
        self.__buffa_cached_size.get()
    }
    fn clear(&mut self) {
        self.sequence_number = 0u64;
        self.__buffa_unknown_fields.clear();
        self.__buffa_cached_size.set(0);
    }
}
impl ::buffa::ExtensionSet for PutResponse {
    const PROTO_FQN: &'static str = "store.ingest.v1.PutResponse";
    fn unknown_fields(&self) -> &::buffa::UnknownFields {
        &self.__buffa_unknown_fields
    }
    fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
        &mut self.__buffa_unknown_fields
    }
}
impl ::buffa::json_helpers::ProtoElemJson for PutResponse {
    fn serialize_proto_json<S: ::serde::Serializer>(
        v: &Self,
        s: S,
    ) -> ::core::result::Result<S::Ok, S::Error> {
        ::serde::Serialize::serialize(v, s)
    }
    fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
        d: D,
    ) -> ::core::result::Result<Self, D::Error> {
        <Self as ::serde::Deserialize>::deserialize(d)
    }
}
#[doc(hidden)]
pub const __PUT_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
    type_url: "type.googleapis.com/store.ingest.v1.PutResponse",
    to_json: ::buffa::type_registry::any_to_json::<PutResponse>,
    from_json: ::buffa::type_registry::any_from_json::<PutResponse>,
    is_wkt: false,
};
/// Response from a successful Put.
#[derive(Clone, Debug, Default)]
pub struct PutResponseView<'a> {
    /// Monotonically increasing store sequence number assigned to this write
    /// batch. Pass to query RPCs as `min_sequence_number` to ensure subsequent
    /// reads reflect this write.
    ///
    /// Field 1: `sequence_number`
    pub sequence_number: u64,
    pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> PutResponseView<'a> {
    /// Decode from `buf`, enforcing a recursion depth limit for nested messages.
    ///
    /// Called by [`::buffa::MessageView::decode_view`] with [`::buffa::RECURSION_LIMIT`]
    /// and by generated sub-message decode arms with `depth - 1`.
    ///
    /// **Not part of the public API.** Named with a leading underscore to
    /// signal that it is for generated-code use only.
    #[doc(hidden)]
    pub fn _decode_depth(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        let mut view = Self::default();
        view._merge_into_view(buf, depth)?;
        ::core::result::Result::Ok(view)
    }
    /// Merge fields from `buf` into this view (proto merge semantics).
    ///
    /// Repeated fields append; singular fields last-wins; singular
    /// MESSAGE fields merge recursively. Used by sub-message decode
    /// arms when the same field appears multiple times on the wire.
    ///
    /// **Not part of the public API.**
    #[doc(hidden)]
    pub fn _merge_into_view(
        &mut self,
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<(), ::buffa::DecodeError> {
        let _ = depth;
        #[allow(unused_variables)]
        let view = self;
        let mut cur: &'a [u8] = buf;
        while !cur.is_empty() {
            let before_tag = cur;
            let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
            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,
                        });
                    }
                    view.sequence_number = ::buffa::types::decode_uint64(&mut cur)?;
                }
                _ => {
                    ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
                    let span_len = before_tag.len() - cur.len();
                    view.__buffa_unknown_fields.push_raw(&before_tag[..span_len]);
                }
            }
        }
        ::core::result::Result::Ok(())
    }
}
impl<'a> ::buffa::MessageView<'a> for PutResponseView<'a> {
    type Owned = PutResponse;
    fn decode_view(buf: &'a [u8]) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
    }
    fn decode_view_with_limit(
        buf: &'a [u8],
        depth: u32,
    ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
        Self::_decode_depth(buf, depth)
    }
    /// Convert this view to the owned message type.
    #[allow(clippy::redundant_closure, clippy::useless_conversion)]
    fn to_owned_message(&self) -> PutResponse {
        #[allow(unused_imports)]
        use ::buffa::alloc::string::ToString as _;
        PutResponse {
            sequence_number: self.sequence_number,
            __buffa_unknown_fields: self
                .__buffa_unknown_fields
                .to_owned()
                .unwrap_or_default()
                .into(),
            ..::core::default::Default::default()
        }
    }
}
unsafe impl ::buffa::DefaultViewInstance for PutResponseView<'static> {
    fn default_view_instance() -> &'static Self {
        static VALUE: ::buffa::__private::OnceBox<PutResponseView<'static>> = ::buffa::__private::OnceBox::new();
        VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
    }
}
unsafe impl<'a> ::buffa::HasDefaultViewInstance for PutResponseView<'a> {
    type Static = PutResponseView<'static>;
}

/// Full service name for this service.
pub const SERVICE_SERVICE_NAME: &str = "store.ingest.v1.Service";
/// Ingest service for writing key-value pairs into the store.
///
/// # Implementing handlers
///
/// Handlers receive requests as `OwnedView<FooView<'static>>`, which gives
/// zero-copy borrowed access to fields (e.g. `request.name` is a `&str`
/// into the decoded buffer). The view can be held across `.await` points.
///
/// Implement methods with plain `async fn`; the returned future satisfies
/// the `Send` bound automatically. See the
/// [buffa user guide](https://github.com/anthropics/buffa/blob/main/docs/guide.md#ownedview-in-async-trait-implementations)
/// for zero-copy access patterns and when `to_owned_message()` is needed.
#[allow(clippy::type_complexity)]
pub trait Service: Send + Sync + 'static {
    /// Atomically write a batch of key-value pairs. On success the entire batch
    /// is persisted and the response carries the store sequence number that
    /// covers this write. Clients can pass that sequence number to query RPCs
    /// (via `min_sequence_number`) for read-after-write consistency.
    fn put(
        &self,
        ctx: ::connectrpc::Context,
        request: ::buffa::view::OwnedView<PutRequestView<'static>>,
    ) -> impl ::std::future::Future<
        Output = Result<(PutResponse, ::connectrpc::Context), ::connectrpc::ConnectError>,
    > + Send;
}
/// Extension trait for registering a service implementation with a Router.
///
/// This trait is automatically implemented for all types that implement the service trait.
///
/// # Example
///
/// ```rust,ignore
/// use std::sync::Arc;
///
/// let service = Arc::new(MyServiceImpl);
/// let router = service.register(Router::new());
/// ```
pub trait ServiceExt: Service {
    /// Register this service implementation with a Router.
    ///
    /// Takes ownership of the `Arc<Self>` and returns a new Router with
    /// this service's methods registered.
    fn register(
        self: ::std::sync::Arc<Self>,
        router: ::connectrpc::Router,
    ) -> ::connectrpc::Router;
}
impl<S: Service> ServiceExt for S {
    fn register(
        self: ::std::sync::Arc<Self>,
        router: ::connectrpc::Router,
    ) -> ::connectrpc::Router {
        router
            .route_view(
                SERVICE_SERVICE_NAME,
                "Put",
                {
                    let svc = ::std::sync::Arc::clone(&self);
                    ::connectrpc::view_handler_fn(move |ctx, req| {
                        let svc = ::std::sync::Arc::clone(&svc);
                        async move { svc.put(ctx, req).await }
                    })
                },
            )
    }
}
/// Monomorphic dispatcher for `Service`.
///
/// Unlike `.register(Router)` which type-erases each method into an `Arc<dyn ErasedHandler>` stored in a `HashMap`, this struct dispatches via a compile-time `match` on method name: no vtable, no hash lookup.
///
/// # Example
///
/// ```rust,ignore
/// use connectrpc::ConnectRpcService;
///
/// let server = ServiceServer::new(MyImpl);
/// let service = ConnectRpcService::new(server);
/// // hand `service` to axum/hyper as a fallback_service
/// ```
pub struct ServiceServer<T> {
    inner: ::std::sync::Arc<T>,
}
impl<T: Service> ServiceServer<T> {
    /// Wrap a service implementation in a monomorphic dispatcher.
    pub fn new(service: T) -> Self {
        Self {
            inner: ::std::sync::Arc::new(service),
        }
    }
    /// Wrap an already-`Arc`'d service implementation.
    pub fn from_arc(inner: ::std::sync::Arc<T>) -> Self {
        Self { inner }
    }
}
impl<T> Clone for ServiceServer<T> {
    fn clone(&self) -> Self {
        Self {
            inner: ::std::sync::Arc::clone(&self.inner),
        }
    }
}
impl<T: Service> ::connectrpc::Dispatcher for ServiceServer<T> {
    #[inline]
    fn lookup(
        &self,
        path: &str,
    ) -> Option<::connectrpc::dispatcher::codegen::MethodDescriptor> {
        let method = path.strip_prefix("store.ingest.v1.Service/")?;
        match method {
            "Put" => {
                Some(::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false))
            }
            _ => None,
        }
    }
    fn call_unary(
        &self,
        path: &str,
        ctx: ::connectrpc::Context,
        request: ::buffa::bytes::Bytes,
        format: ::connectrpc::CodecFormat,
    ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
        let Some(method) = path.strip_prefix("store.ingest.v1.Service/") else {
            return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
        };
        let _ = (&ctx, &request, &format);
        match method {
            "Put" => {
                let svc = ::std::sync::Arc::clone(&self.inner);
                Box::pin(async move {
                    let req = ::connectrpc::dispatcher::codegen::decode_request_view::<
                        PutRequestView,
                    >(request, format)?;
                    let (res, ctx) = svc.put(ctx, req).await?;
                    let bytes = ::connectrpc::dispatcher::codegen::encode_response(
                        &res,
                        format,
                    )?;
                    Ok((bytes, ctx))
                })
            }
            _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
        }
    }
    fn call_server_streaming(
        &self,
        path: &str,
        ctx: ::connectrpc::Context,
        request: ::buffa::bytes::Bytes,
        format: ::connectrpc::CodecFormat,
    ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
        let Some(method) = path.strip_prefix("store.ingest.v1.Service/") else {
            return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
        };
        let _ = (&ctx, &request, &format);
        match method {
            _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
        }
    }
    fn call_client_streaming(
        &self,
        path: &str,
        ctx: ::connectrpc::Context,
        requests: ::connectrpc::dispatcher::codegen::RequestStream,
        format: ::connectrpc::CodecFormat,
    ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
        let Some(method) = path.strip_prefix("store.ingest.v1.Service/") else {
            return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
        };
        let _ = (&ctx, &requests, &format);
        match method {
            _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
        }
    }
    fn call_bidi_streaming(
        &self,
        path: &str,
        ctx: ::connectrpc::Context,
        requests: ::connectrpc::dispatcher::codegen::RequestStream,
        format: ::connectrpc::CodecFormat,
    ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
        let Some(method) = path.strip_prefix("store.ingest.v1.Service/") else {
            return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
        };
        let _ = (&ctx, &requests, &format);
        match method {
            _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
        }
    }
}
/// Client for this service.
///
/// Generic over `T: ClientTransport`. For **gRPC** (HTTP/2), use
/// `Http2Connection` — it has honest `poll_ready` and composes with
/// `tower::balance` for multi-connection load balancing. For **Connect
/// over HTTP/1.1** (or unknown protocol), use `HttpClient`.
///
/// # Example (gRPC / HTTP/2)
///
/// ```rust,ignore
/// use connectrpc::client::{Http2Connection, ClientConfig};
/// use connectrpc::Protocol;
///
/// let uri: http::Uri = "http://localhost:8080".parse()?;
/// let conn = Http2Connection::connect_plaintext(uri.clone()).await?.shared(1024);
/// let config = ClientConfig::new(uri).protocol(Protocol::Grpc);
///
/// let client = ServiceClient::new(conn, config);
/// let response = client.put(request).await?;
/// ```
///
/// # Example (Connect / HTTP/1.1 or ALPN)
///
/// ```rust,ignore
/// use connectrpc::client::{HttpClient, ClientConfig};
///
/// let http = HttpClient::plaintext();  // cleartext http:// only
/// let config = ClientConfig::new("http://localhost:8080".parse()?);
///
/// let client = ServiceClient::new(http, config);
/// let response = client.put(request).await?;
/// ```
///
/// # Working with the response
///
/// Unary calls return [`UnaryResponse<OwnedView<FooView>>`](::connectrpc::client::UnaryResponse).
/// The `OwnedView` derefs to the view, so field access is zero-copy:
///
/// ```rust,ignore
/// let resp = client.put(request).await?.into_view();
/// let name: &str = resp.name;  // borrow into the response buffer
/// ```
///
/// If you need the owned struct (e.g. to store or pass by value), use
/// [`into_owned()`](::connectrpc::client::UnaryResponse::into_owned):
///
/// ```rust,ignore
/// let owned = client.put(request).await?.into_owned();
/// ```
#[derive(Clone)]
pub struct ServiceClient<T> {
    transport: T,
    config: ::connectrpc::client::ClientConfig,
}
impl<T> ServiceClient<T>
where
    T: ::connectrpc::client::ClientTransport,
    <T::ResponseBody as ::http_body::Body>::Error: ::std::fmt::Display,
{
    /// Create a new client with the given transport and configuration.
    pub fn new(transport: T, config: ::connectrpc::client::ClientConfig) -> Self {
        Self { transport, config }
    }
    /// Get the client configuration.
    pub fn config(&self) -> &::connectrpc::client::ClientConfig {
        &self.config
    }
    /// Get a mutable reference to the client configuration.
    pub fn config_mut(&mut self) -> &mut ::connectrpc::client::ClientConfig {
        &mut self.config
    }
    /// Call the Put RPC. Sends a request to /store.ingest.v1.Service/Put.
    pub async fn put(
        &self,
        request: PutRequest,
    ) -> Result<
        ::connectrpc::client::UnaryResponse<
            ::buffa::view::OwnedView<PutResponseView<'static>>,
        >,
        ::connectrpc::ConnectError,
    > {
        self.put_with_options(request, ::connectrpc::client::CallOptions::default())
            .await
    }
    /// Call the Put RPC with explicit per-call options. Options override [`connectrpc::client::ClientConfig`] defaults.
    pub async fn put_with_options(
        &self,
        request: PutRequest,
        options: ::connectrpc::client::CallOptions,
    ) -> Result<
        ::connectrpc::client::UnaryResponse<
            ::buffa::view::OwnedView<PutResponseView<'static>>,
        >,
        ::connectrpc::ConnectError,
    > {
        ::connectrpc::client::call_unary(
                &self.transport,
                &self.config,
                SERVICE_SERVICE_NAME,
                "Put",
                request,
                options,
            )
            .await
    }
}