gleamunison/codebase

Types

pub opaque type Codebase
pub type InsertError {
  HashMismatch(
    hash_expected: identity.Hash,
    hash_got: identity.Hash,
  )
  DuplicateDef(
    existing: identity.DefinitionRef,
    incoming: identity.DefinitionRef,
  )
}

Constructors

Values

pub fn empty() -> Codebase
pub fn get_adapter(codebase: Codebase) -> storage.StorageAdapter
pub fn hash_of_definition(def: ast.Definition) -> identity.Hash
pub fn insert(
  codebase: Codebase,
  unit: ast.Unit,
) -> Result(Codebase, InsertError)
pub fn insert_raw(
  codebase: Codebase,
  ref: identity.DefinitionRef,
  bytes: BitArray,
) -> Codebase
pub fn list_refs(
  codebase: Codebase,
) -> List(identity.DefinitionRef)
Search Document