fragmentation/store

Types

Content-addressed fragment store.

pub opaque type Store

Values

pub fn get(
  store: Store,
  s: fragmentation.Sha,
) -> Result(fragmentation.Fragment, Nil)

Look up a fragment by SHA.

pub fn has(store: Store, s: fragmentation.Sha) -> Bool

Check if a fragment exists.

pub fn keys(store: Store) -> List(fragmentation.Sha)

List all SHAs in the store.

pub fn merge(a: Store, b: Store) -> Store

Merge two stores. Same SHA = same content.

pub fn new() -> Store

Create an empty store.

pub fn put(store: Store, frag: fragmentation.Fragment) -> Store

Insert a fragment by its self-ref SHA.

pub fn size(store: Store) -> Int

Count fragments in the store.

Search Document