Trait ObjectStore

Source
pub trait ObjectStore:
    Sync
    + Send
    + Debug {
    // Required methods
    fn list_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prefix: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<FileMetaStream>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_dir<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prefix: &'life1 str,
        delimiter: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<ListEntryStream>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn file_reader(&self, file: SizedFile) -> Result<Arc<dyn ObjectReader>>;
}
Expand description

A ObjectStore abstracts access to an underlying file/object storage. It maps strings (e.g. URLs, filesystem paths, etc) to sources of bytes

Required Methods§

Source

fn list_file<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<FileMetaStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns all the files in path prefix

Source

fn list_dir<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 str, delimiter: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<ListEntryStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns all the files in prefix if the prefix is already a leaf dir, or all paths between the prefix and the first occurrence of the delimiter if it is provided.

Source

fn file_reader(&self, file: SizedFile) -> Result<Arc<dyn ObjectReader>>

Get object reader for one file

Implementors§