kitsune2_api/proto/gen/
kitsune2.fetch.rs

1// This file is @generated by prost-build.
2/// A fetch request.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct FetchRequest {
5    /// Op ids.
6    #[prost(bytes = "bytes", repeated, tag = "1")]
7    pub op_ids: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8}
9/// A fetch response.
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct FetchResponse {
12    /// Ops.
13    #[prost(message, repeated, tag = "1")]
14    pub ops: ::prost::alloc::vec::Vec<super::op_store::Op>,
15}
16/// Fetch message.
17#[derive(Clone, PartialEq, ::prost::Message)]
18pub struct K2FetchMessage {
19    /// Message type.
20    #[prost(enumeration = "k2_fetch_message::FetchMessageType", tag = "1")]
21    pub fetch_message_type: i32,
22    /// Message.
23    #[prost(bytes = "bytes", tag = "2")]
24    pub data: ::prost::bytes::Bytes,
25}
26/// Nested message and enum types in `K2FetchMessage`.
27pub mod k2_fetch_message {
28    /// Fetch message type.
29    ///
30    /// This enum is used to indicate the content of `data`.
31    /// So, REQUEST -> FetchRequest and RESPONSE -> FetchResponse.
32    #[derive(
33        Clone,
34        Copy,
35        Debug,
36        PartialEq,
37        Eq,
38        Hash,
39        PartialOrd,
40        Ord,
41        ::prost::Enumeration
42    )]
43    #[repr(i32)]
44    pub enum FetchMessageType {
45        /// Default value.
46        Unspecified = 0,
47        /// A fetch request.
48        Request = 1,
49        /// A fetch response.
50        Response = 2,
51    }
52    impl FetchMessageType {
53        /// String value of the enum field names used in the ProtoBuf definition.
54        ///
55        /// The values are not transformed in any way and thus are considered stable
56        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
57        pub fn as_str_name(&self) -> &'static str {
58            match self {
59                Self::Unspecified => "UNSPECIFIED",
60                Self::Request => "REQUEST",
61                Self::Response => "RESPONSE",
62            }
63        }
64        /// Creates an enum from field names used in the ProtoBuf definition.
65        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
66            match value {
67                "UNSPECIFIED" => Some(Self::Unspecified),
68                "REQUEST" => Some(Self::Request),
69                "RESPONSE" => Some(Self::Response),
70                _ => None,
71            }
72        }
73    }
74}