use crate::error::VtaResult;
use crate::platform::Platform;
use crate::types::Artifact;
use std::path::Path;
pub trait Provider {
fn id(&self) -> &str;
fn list_versions(&self) -> VtaResult<Vec<String>>;
fn resolve(&self, version: &str, platform: &Platform) -> VtaResult<Artifact>;
}
pub trait Backend {
fn name(&self) -> &str;
fn fetch(&self, url: &str, dest: &Path) -> VtaResult<()>;
}
pub trait CacheStore {
fn get(&self, key: &str) -> VtaResult<Option<Vec<u8>>>;
fn put(&self, key: &str, bytes: &[u8]) -> VtaResult<()>;
}
pub trait SignatureVerifier {
fn scheme(&self) -> &str;
fn verify(&self, data: &[u8], signature: &str) -> VtaResult<bool>;
}
pub trait LinkStrategy {
fn name(&self) -> &str;
fn probe(&self, dir: &Path) -> bool;
fn link(&self, src: &Path, dst: &Path) -> VtaResult<()>;
}