sedimentree_core 0.6.0

Sedimentree: a hash-linked CRDT storage structure with fragments, commits, and content-addressed blobs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Trait for types that have associated blob metadata.

use super::BlobMeta;

/// Types that have associated blob metadata.
///
/// This trait is implemented by types that reference a blob and declare its
/// size and content hash.
pub trait HasBlobMeta {
    /// Arguments needed to construct this type (besides `BlobMeta`).
    type Args;

    /// Returns the blob metadata for this type.
    fn blob_meta(&self) -> BlobMeta;

    /// Construct from arguments and blob metadata.
    fn from_args(args: Self::Args, blob_meta: BlobMeta) -> Self;
}