Skip to main content

StorageProvider

Trait StorageProvider 

Source
pub trait StorageProvider: Send + Sync {
    // Required methods
    async fn get_manifest(
        &self,
        project_id: &str,
    ) -> StorageResult<Option<Vec<u8>>>;
    async fn put_manifest(
        &self,
        project_id: &str,
        manifest_payload: &[u8],
    ) -> StorageResult<()>;
    async fn upload_blob(&self, hash: &str, data: Vec<u8>) -> StorageResult<()>;
    async fn download_blob(&self, hash: &str) -> StorageResult<Option<Vec<u8>>>;
    async fn create_invite(
        &self,
        user_id: &str,
        vault_id: &str,
        payload: Vec<u8>,
    ) -> StorageResult<()>;
    async fn get_invites(
        &self,
        user_id: &str,
        vault_id: &str,
    ) -> StorageResult<Vec<Vec<u8>>>;
}

Required Methods§

Source

async fn get_manifest(&self, project_id: &str) -> StorageResult<Option<Vec<u8>>>

Source

async fn put_manifest( &self, project_id: &str, manifest_payload: &[u8], ) -> StorageResult<()>

Source

async fn upload_blob(&self, hash: &str, data: Vec<u8>) -> StorageResult<()>

Source

async fn download_blob(&self, hash: &str) -> StorageResult<Option<Vec<u8>>>

Source

async fn create_invite( &self, user_id: &str, vault_id: &str, payload: Vec<u8>, ) -> StorageResult<()>

Source

async fn get_invites( &self, user_id: &str, vault_id: &str, ) -> StorageResult<Vec<Vec<u8>>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§