pub struct AliasManager { /* private fields */ }Expand description
Manages human-readable aliases for sequences and collections.
Implementations§
Source§impl AliasManager
impl AliasManager
pub fn new() -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn add_sequence(
&mut self,
namespace: &str,
alias: &str,
digest: &str,
force: bool,
) -> Result<()>
pub fn add_sequence( &mut self, namespace: &str, alias: &str, digest: &str, force: bool, ) -> Result<()>
Bind a sequence alias. Errors if it already points to a different
digest, unless force.
pub fn resolve_sequence(&self, namespace: &str, alias: &str) -> Option<[u8; 48]>
pub fn reverse_lookup_sequence(&self, digest: &str) -> Vec<(String, String)>
pub fn sequence_namespaces(&self) -> Vec<String>
pub fn sequence_aliases(&self, namespace: &str) -> Option<Vec<String>>
pub fn remove_sequence(&mut self, namespace: &str, alias: &str) -> bool
Sourcepub fn load_sequence_tsv(
&mut self,
namespace: &str,
path: &Path,
force: bool,
) -> Result<Vec<String>>
pub fn load_sequence_tsv( &mut self, namespace: &str, path: &Path, force: bool, ) -> Result<Vec<String>>
Load a TSV of sequence aliases, all or nothing, returning the distinct
alias names bound. See [alias_load_tsv] for what is refused.
Sourcepub fn add_collection(
&mut self,
namespace: &str,
alias: &str,
digest: &str,
force: bool,
) -> Result<()>
pub fn add_collection( &mut self, namespace: &str, alias: &str, digest: &str, force: bool, ) -> Result<()>
Bind a collection alias. Errors if it already points to a different
digest, unless force.
pub fn resolve_collection( &self, namespace: &str, alias: &str, ) -> Option<[u8; 48]>
pub fn reverse_lookup_collection(&self, digest: &str) -> Vec<(String, String)>
pub fn collection_namespaces(&self) -> Vec<String>
pub fn collection_aliases(&self, namespace: &str) -> Option<Vec<String>>
pub fn remove_collection(&mut self, namespace: &str, alias: &str) -> bool
Sourcepub fn load_collection_tsv(
&mut self,
namespace: &str,
path: &Path,
force: bool,
) -> Result<Vec<String>>
pub fn load_collection_tsv( &mut self, namespace: &str, path: &Path, force: bool, ) -> Result<Vec<String>>
Load a TSV of collection aliases, all or nothing, returning the distinct
alias names bound. See [alias_load_tsv] for what is refused.
pub fn load_from_dir(&mut self, aliases_dir: &Path) -> Result<()>
Sourcepub fn load_namespaces_from_dir(
&mut self,
aliases_dir: &Path,
sequence_namespaces: &[String],
collection_namespaces: &[String],
) -> Result<()>
pub fn load_namespaces_from_dir( &mut self, aliases_dir: &Path, sequence_namespaces: &[String], collection_namespaces: &[String], ) -> Result<()>
Load only the alias namespaces explicitly listed (the manifest-driven
path). Unlike load_from_dir, which scans the directory for any *.tsv
present, this loads exactly <aliases_dir>/{sequences,collections}/<ns>.tsv
for each listed namespace. This makes rgstore.json the single source of
truth for what a store advertises: an alias file on disk that the manifest
does not list is simply not loaded, so a stale manifest fails identically
on a local filesystem and over HTTP (where directory listing is impossible).