Skip to main content

FileSystem

Trait FileSystem 

Source
pub trait FileSystem:
    Debug
    + Send
    + Sync {
    // Required methods
    fn list(&self, prefix: &str) -> BoxStream<'_, VortexResult<FileListing>>;
    fn open_read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = VortexResult<Arc<dyn VortexReadAt>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A storage-agnostic filesystem interface for discovering and reading Vortex files.

Implementations handle the details of a particular storage backend (local disk, S3, GCS, etc.) while consumers work through this uniform interface.

§Future Work

An open_write method will be added once VortexWrite is object-safe (it currently uses impl Future return types which prevent trait-object usage).

Required Methods§

Source

fn list(&self, prefix: &str) -> BoxStream<'_, VortexResult<FileListing>>

Recursively list files whose paths start with prefix.

When prefix is empty, all files are listed. Implementations must recurse into subdirectories so that the returned stream contains every file reachable under the prefix.

Returns a stream of FileListing entries. The stream may yield entries in any order; callers should sort if deterministic ordering is required.

Source

fn open_read<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = VortexResult<Arc<dyn VortexReadAt>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Open a file for reading at the given path.

Implementations§

Source§

impl dyn FileSystem + '_

Source

pub fn glob( &self, pattern: &str, ) -> VortexResult<BoxStream<'_, VortexResult<FileListing>>>

Expand a glob pattern, returning matching files as a stream.

Extracts the directory prefix before the first glob character and uses it to narrow the list call. The full glob pattern is then applied as a filter over the listed entries.

Escaped glob characters (\*, \?, \[) are not supported.

Source§

impl dyn FileSystem + 'static

Source

pub fn with_prefix(self: Arc<Self>, prefix: String) -> FileSystemRef

Create a new filesystem that applies the given prefix to all operations on this filesystem.

Implementors§

Source§

impl FileSystem for ObjectStoreFileSystem

Source§

impl<F: FileSystem> FileSystem for Compat<F>

Compatibility adapter for FileSystem implementations that are based on Tokio.