Skip to main content

claw_core/generated/
claw.common.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3pub struct ObjectId {
4    #[prost(bytes = "vec", tag = "1")]
5    pub hash: ::prost::alloc::vec::Vec<u8>,
6}
7#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8pub struct Timestamp {
9    #[prost(uint64, tag = "1")]
10    pub seconds: u64,
11}
12#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
13pub struct Ulid {
14    #[prost(bytes = "vec", tag = "1")]
15    pub data: ::prost::alloc::vec::Vec<u8>,
16}
17#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
18pub struct Signature {
19    #[prost(string, tag = "1")]
20    pub signer_id: ::prost::alloc::string::String,
21    #[prost(bytes = "vec", tag = "2")]
22    pub ed25519_sig: ::prost::alloc::vec::Vec<u8>,
23}
24#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
25#[repr(i32)]
26pub enum ObjectType {
27    Unspecified = 0,
28    Blob = 1,
29    Tree = 2,
30    Patch = 3,
31    Revision = 4,
32    Snapshot = 5,
33    Intent = 6,
34    Change = 7,
35    Conflict = 8,
36    Capsule = 9,
37    Policy = 10,
38    Workstream = 11,
39    Reflog = 12,
40}
41impl ObjectType {
42    /// String value of the enum field names used in the ProtoBuf definition.
43    ///
44    /// The values are not transformed in any way and thus are considered stable
45    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
46    pub fn as_str_name(&self) -> &'static str {
47        match self {
48            Self::Unspecified => "OBJECT_TYPE_UNSPECIFIED",
49            Self::Blob => "OBJECT_TYPE_BLOB",
50            Self::Tree => "OBJECT_TYPE_TREE",
51            Self::Patch => "OBJECT_TYPE_PATCH",
52            Self::Revision => "OBJECT_TYPE_REVISION",
53            Self::Snapshot => "OBJECT_TYPE_SNAPSHOT",
54            Self::Intent => "OBJECT_TYPE_INTENT",
55            Self::Change => "OBJECT_TYPE_CHANGE",
56            Self::Conflict => "OBJECT_TYPE_CONFLICT",
57            Self::Capsule => "OBJECT_TYPE_CAPSULE",
58            Self::Policy => "OBJECT_TYPE_POLICY",
59            Self::Workstream => "OBJECT_TYPE_WORKSTREAM",
60            Self::Reflog => "OBJECT_TYPE_REFLOG",
61        }
62    }
63    /// Creates an enum from field names used in the ProtoBuf definition.
64    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
65        match value {
66            "OBJECT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
67            "OBJECT_TYPE_BLOB" => Some(Self::Blob),
68            "OBJECT_TYPE_TREE" => Some(Self::Tree),
69            "OBJECT_TYPE_PATCH" => Some(Self::Patch),
70            "OBJECT_TYPE_REVISION" => Some(Self::Revision),
71            "OBJECT_TYPE_SNAPSHOT" => Some(Self::Snapshot),
72            "OBJECT_TYPE_INTENT" => Some(Self::Intent),
73            "OBJECT_TYPE_CHANGE" => Some(Self::Change),
74            "OBJECT_TYPE_CONFLICT" => Some(Self::Conflict),
75            "OBJECT_TYPE_CAPSULE" => Some(Self::Capsule),
76            "OBJECT_TYPE_POLICY" => Some(Self::Policy),
77            "OBJECT_TYPE_WORKSTREAM" => Some(Self::Workstream),
78            "OBJECT_TYPE_REFLOG" => Some(Self::Reflog),
79            _ => None,
80        }
81    }
82}