kellnr-storage 6.5.3

Kellnr is a self-hosted registry for Rust crates with support for rustdocs and crates.io caching.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use async_trait::async_trait;
use bytes::Bytes;

use crate::storage_error::StorageError;

#[async_trait]
pub trait Storage {
    async fn get(&self, key: &str) -> Result<Bytes, StorageError>;
    async fn put(&self, key: &str, object: Bytes) -> Result<(), StorageError>;
    async fn delete(&self, key: &str) -> Result<(), StorageError>;
    async fn exists(&self, key: &str) -> Result<bool, StorageError>;
}