Skip to main content

DirectoryFileSystem

Trait DirectoryFileSystem 

Source
pub trait DirectoryFileSystem: FileSystem {
    // Required methods
    fn create_dir_one(&mut self, path: &Path, mode: u32) -> VfResult<()>;
    fn read_dir_one(
        &mut self,
        path: &Path,
        options: ReadDirOptions,
    ) -> VfResult<Vec<DirEntry>>;
    fn read_dir_page(
        &mut self,
        path: &Path,
        cursor: Option<DirPageCursor>,
        page_size: usize,
        max_entries: usize,
    ) -> VfResult<(Vec<DirEntry>, Option<DirPageCursor>)>;

    // Provided method
    fn read_dir_page_with_fields(
        &mut self,
        path: &Path,
        fields: AttrMask,
        cursor: Option<DirPageCursor>,
        page_size: usize,
        max_entries: usize,
    ) -> VfResult<(Vec<DirEntry>, Option<DirPageCursor>)> { ... }
}
Expand description

Directory creation and enumeration.

Required Methods§

Source

fn create_dir_one(&mut self, path: &Path, mode: u32) -> VfResult<()>

Source

fn read_dir_one( &mut self, path: &Path, options: ReadDirOptions, ) -> VfResult<Vec<DirEntry>>

Source

fn read_dir_page( &mut self, path: &Path, cursor: Option<DirPageCursor>, page_size: usize, max_entries: usize, ) -> VfResult<(Vec<DirEntry>, Option<DirPageCursor>)>

Return one bounded page without invoking application code under a mutable backend borrow. The continuation token is backend-specific.

Provided Methods§

Source

fn read_dir_page_with_fields( &mut self, path: &Path, fields: AttrMask, cursor: Option<DirPageCursor>, page_size: usize, max_entries: usize, ) -> VfResult<(Vec<DirEntry>, Option<DirPageCursor>)>

Selected metadata on one bounded page. Implementations may return a superset; the default uses the backend’s ordinary paged enumeration.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§