aleph-cid 0.1.0

kubo-compatible IPFS CID computation for Aleph Cloud: UnixFS dag-pb hashing, HAMT-sharded directories and CARv1 framing.
Documentation
// @generated by prost-build from crates/aleph-cid/proto/unixfs.proto
// Do not edit manually. Regenerate with: just generate-proto
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Data {
    #[prost(enumeration = "DataType", required, tag = "1")]
    pub r#type: i32,
    #[prost(bytes = "vec", optional, tag = "2")]
    pub data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
    #[prost(uint64, optional, tag = "3")]
    pub filesize: ::core::option::Option<u64>,
    #[prost(uint64, repeated, packed = "false", tag = "4")]
    pub blocksizes: ::prost::alloc::vec::Vec<u64>,
    #[prost(uint64, optional, tag = "5")]
    pub hash_type: ::core::option::Option<u64>,
    #[prost(uint64, optional, tag = "6")]
    pub fanout: ::core::option::Option<u64>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DataType {
    Raw = 0,
    Directory = 1,
    File = 2,
    Metadata = 3,
    Symlink = 4,
    HamtShard = 5,
}
impl DataType {
    /// 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::Raw => "Raw",
            Self::Directory => "Directory",
            Self::File => "File",
            Self::Metadata => "Metadata",
            Self::Symlink => "Symlink",
            Self::HamtShard => "HAMTShard",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "Raw" => Some(Self::Raw),
            "Directory" => Some(Self::Directory),
            "File" => Some(Self::File),
            "Metadata" => Some(Self::Metadata),
            "Symlink" => Some(Self::Symlink),
            "HAMTShard" => Some(Self::HamtShard),
            _ => None,
        }
    }
}