Skip to main content

kellnr_storage/
storage.rs

1use async_trait::async_trait;
2use bytes::Bytes;
3
4use crate::storage_error::StorageError;
5
6#[async_trait]
7pub trait Storage {
8    async fn get(&self, key: &str) -> Result<Bytes, StorageError>;
9    async fn put(&self, key: &str, object: Bytes) -> Result<(), StorageError>;
10    async fn delete(&self, key: &str) -> Result<(), StorageError>;
11    async fn exists(&self, key: &str) -> Result<bool, StorageError>;
12}