claw-vcs-core 0.1.1

Core object types and Claw Object Format encoding for Claw VCS.
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ObjectId {
    #[prost(bytes = "vec", tag = "1")]
    pub hash: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Timestamp {
    #[prost(uint64, tag = "1")]
    pub seconds: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Ulid {
    #[prost(bytes = "vec", tag = "1")]
    pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Signature {
    #[prost(string, tag = "1")]
    pub signer_id: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "2")]
    pub ed25519_sig: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ObjectType {
    Unspecified = 0,
    Blob = 1,
    Tree = 2,
    Patch = 3,
    Revision = 4,
    Snapshot = 5,
    Intent = 6,
    Change = 7,
    Conflict = 8,
    Capsule = 9,
    Policy = 10,
    Workstream = 11,
    Reflog = 12,
}
impl ObjectType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "OBJECT_TYPE_UNSPECIFIED",
            Self::Blob => "OBJECT_TYPE_BLOB",
            Self::Tree => "OBJECT_TYPE_TREE",
            Self::Patch => "OBJECT_TYPE_PATCH",
            Self::Revision => "OBJECT_TYPE_REVISION",
            Self::Snapshot => "OBJECT_TYPE_SNAPSHOT",
            Self::Intent => "OBJECT_TYPE_INTENT",
            Self::Change => "OBJECT_TYPE_CHANGE",
            Self::Conflict => "OBJECT_TYPE_CONFLICT",
            Self::Capsule => "OBJECT_TYPE_CAPSULE",
            Self::Policy => "OBJECT_TYPE_POLICY",
            Self::Workstream => "OBJECT_TYPE_WORKSTREAM",
            Self::Reflog => "OBJECT_TYPE_REFLOG",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "OBJECT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "OBJECT_TYPE_BLOB" => Some(Self::Blob),
            "OBJECT_TYPE_TREE" => Some(Self::Tree),
            "OBJECT_TYPE_PATCH" => Some(Self::Patch),
            "OBJECT_TYPE_REVISION" => Some(Self::Revision),
            "OBJECT_TYPE_SNAPSHOT" => Some(Self::Snapshot),
            "OBJECT_TYPE_INTENT" => Some(Self::Intent),
            "OBJECT_TYPE_CHANGE" => Some(Self::Change),
            "OBJECT_TYPE_CONFLICT" => Some(Self::Conflict),
            "OBJECT_TYPE_CAPSULE" => Some(Self::Capsule),
            "OBJECT_TYPE_POLICY" => Some(Self::Policy),
            "OBJECT_TYPE_WORKSTREAM" => Some(Self::Workstream),
            "OBJECT_TYPE_REFLOG" => Some(Self::Reflog),
            _ => None,
        }
    }
}