Skip to main content

SeqColService

Trait SeqColService 

Source
pub trait SeqColService {
    // Required methods
    fn get_collection_level1(&self, digest: &str) -> Result<CollectionLevel1>;
    fn get_collection_level2(&self, digest: &str) -> Result<CollectionLevel2>;
    fn compare(
        &self,
        digest_a: &str,
        digest_b: &str,
    ) -> Result<SeqColComparison>;
    fn compare_with_level2(
        &self,
        digest_a: &str,
        external: &CollectionLevel2,
    ) -> Result<SeqColComparison>;
    fn find_collections_by_attribute(
        &self,
        attr_name: &str,
        attr_digest: &str,
    ) -> Result<Vec<String>>;
    fn get_attribute(
        &self,
        attr_name: &str,
        attr_digest: &str,
    ) -> Result<Option<Value>>;
    fn list_collections(
        &self,
        page: usize,
        page_size: usize,
        filters: &[(&str, &str)],
    ) -> Result<PagedResult<SequenceCollectionMetadata>>;
    fn collection_count(&self) -> usize;
}
Expand description

Trait defining the read-only operations a seqcol API server needs from its backend.

This is the canonical interface for seqcol server operations. Any backend (filesystem-backed ReadonlyRefgetStore, Postgres, remote proxy, in-memory mock) can implement this trait and be used via Arc<dyn SeqColService>.

All methods take &self and return concrete types, making the trait object-safe.

Required Methods§

Source

fn get_collection_level1(&self, digest: &str) -> Result<CollectionLevel1>

Level 1: attribute digests only.

Source

fn get_collection_level2(&self, digest: &str) -> Result<CollectionLevel2>

Level 2: full arrays with values.

Source

fn compare(&self, digest_a: &str, digest_b: &str) -> Result<SeqColComparison>

Compare two collections by digest.

Source

fn compare_with_level2( &self, digest_a: &str, external: &CollectionLevel2, ) -> Result<SeqColComparison>

Compare a stored collection against an externally-provided level-2 body.

Source

fn find_collections_by_attribute( &self, attr_name: &str, attr_digest: &str, ) -> Result<Vec<String>>

Find collections sharing an attribute digest.

Source

fn get_attribute( &self, attr_name: &str, attr_digest: &str, ) -> Result<Option<Value>>

Get the raw attribute array for a given attribute digest.

Source

fn list_collections( &self, page: usize, page_size: usize, filters: &[(&str, &str)], ) -> Result<PagedResult<SequenceCollectionMetadata>>

List collections with pagination and optional attribute filters.

Source

fn collection_count(&self) -> usize

Total number of collections in the store.

Implementors§