Trait UnpackRef

Source
pub trait UnpackRef<Id, R> {
    // Required methods
    fn unpack_atom_ref(&self, root: Option<&R>) -> Option<UnpackedRef<Id, R>>;
    fn find_root_ref(&self) -> Option<R>;
}
Expand description

A trait for unpacking atom references into structured version information.

This trait defines how to parse atom references (from git refs) into structured atom data including labels, versions, and identifiers.

§Reference Format

Atom references follow the pattern: refs/ekala/atoms/{label}/{version} where:

  • label is the atom identifier (e.g., “mylib”, “database”)
  • version is a semantic version (e.g., “1.2.3”)

Required Methods§

Source

fn unpack_atom_ref(&self, root: Option<&R>) -> Option<UnpackedRef<Id, R>>

Attempts to unpack this reference as an atom reference.

§Returns
  • Some((label, version, id)) if the reference follows atom reference format
  • None if the reference is not an atom reference or is malformed
Source

fn find_root_ref(&self) -> Option<R>

Attempts to find the root reference in the store.

Implementations on Foreign Types§

Source§

impl UnpackRef<ObjectId, Root> for Ref

Source§

fn find_root_ref(&self) -> Option<Root>

Source§

fn unpack_atom_ref( &self, root: Option<&Root>, ) -> Option<UnpackedRef<ObjectId, Root>>

Implementors§