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§
Sourcefn list(&self, prefix: &str) -> BoxStream<'_, VortexResult<FileListing>>
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.
Sourcefn 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,
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 + '_
impl dyn FileSystem + '_
Sourcepub fn glob(
&self,
pattern: &str,
) -> VortexResult<BoxStream<'_, VortexResult<FileListing>>>
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
impl dyn FileSystem + 'static
Sourcepub fn with_prefix(self: Arc<Self>, prefix: String) -> FileSystemRef
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§
impl FileSystem for ObjectStoreFileSystem
impl<F: FileSystem> FileSystem for Compat<F>
Compatibility adapter for FileSystem implementations that are based on Tokio.