Skip to main content

StorageBackend

Trait StorageBackend 

Source
pub trait StorageBackend: Send + Sync {
    // Required methods
    fn list_files<'life0, 'life1, 'async_trait>(
        &'life0 self,
        config: &'life1 QueryConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<FileMetadata>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn backend_name(&self) -> &'static str;
}
Expand description

Trait that all storage backends must implement

This trait provides a common interface for listing files from different storage backends (Dropbox, S3, local filesystem, etc.).

Backend implementations handle the specifics of connecting to storage and converting OpenDAL entries to our FileMetadata structure.

Required Methods§

Source

fn list_files<'life0, 'life1, 'async_trait>( &'life0 self, config: &'life1 QueryConfig, ) -> Pin<Box<dyn Future<Output = Result<Vec<FileMetadata>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List files from the storage backend according to the query configuration

§Arguments
  • config - Configuration controlling what to fetch and how
§Returns

A vector of FileMetadata entries

§Errors

Returns an error if the backend fails to list files or if credentials are invalid

Source

fn backend_name(&self) -> &'static str

Get the name of this backend (for logging/debugging)

Implementors§