Trait RepositoryBackendTrait

Source
pub trait RepositoryBackendTrait: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn format(&self) -> ArtifactFormat;
    fn is_writable(&self) -> bool;
    fn fetch(&self, id: &ArtifactId) -> Result<Option<Vec<u8>>>;
    fn put(&self, id: &ArtifactId, data: &[u8]) -> Result<()>;
    fn handle_http2_request(
        &self,
        suburl: &str,
        body: &[u8],
    ) -> Result<(u16, Vec<(String, String)>, Vec<u8>)>;

    // Provided method
    fn fetch_many_with_upstreams(
        &self,
        upstreams: &[Arc<dyn RepositoryBackendTrait>],
        ids: &[ArtifactId],
    ) -> Result<HashMap<ArtifactId, Vec<u8>>> { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn format(&self) -> ArtifactFormat

Source

fn is_writable(&self) -> bool

Source

fn fetch(&self, id: &ArtifactId) -> Result<Option<Vec<u8>>>

Source

fn put(&self, id: &ArtifactId, data: &[u8]) -> Result<()>

Source

fn handle_http2_request( &self, suburl: &str, body: &[u8], ) -> Result<(u16, Vec<(String, String)>, Vec<u8>)>

Provided Methods§

Implementors§