Skip to main content

FileSystem

Trait FileSystem 

Source
pub trait FileSystem: Send + Sync {
Show 28 methods // Required methods fn workspace_usage<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, ) -> Pin<Box<dyn Future<Output = FsResult<WorkspaceUsage>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn stat<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: StatOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn exists<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: StatOptions, ) -> Pin<Box<dyn Future<Output = FsResult<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn read_dir<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<Node>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn tree<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: TreeOptions, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<TreeEntry>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn mkdir<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: CreateOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn read<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: ReadOptions, ) -> Pin<Box<dyn Future<Output = FsResult<FileRead>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn write<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, source: WriteSource, options: WriteOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn write_at<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, offset: u64, source: WriteSource, options: WriteOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn append<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, source: WriteSource, options: WriteOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn truncate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, length: u64, options: MutationOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn touch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: TouchOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn copy<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, from: &'life2 VirtualPath, to: &'life3 VirtualPath, options: CopyOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn move_path<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, from: &'life2 VirtualPath, to: &'life3 VirtualPath, options: MoveOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn remove<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: RemoveOptions, ) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn symlink<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, target: &'life2 LinkTarget, link: &'life3 VirtualPath, options: CreateOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn read_link<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, ) -> Pin<Box<dyn Future<Output = FsResult<LinkTarget>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn trash<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: MutationOptions, ) -> Pin<Box<dyn Future<Output = FsResult<TrashEntry>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn list_trash<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<TrashEntry>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn restore<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, trash: TrashId, destination: Option<&'life2 VirtualPath>, options: MutationOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn purge<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, trash: TrashId, ) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn set_attribute<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, key: &'life3 str, value: &'life4 [u8], options: MutationOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait; fn remove_attribute<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, key: &'life3 str, options: MutationOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn glob<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, pattern: &'life2 str, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<Node>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn find<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, query: FindQuery, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<Node>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn search_content<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, query: ContentQuery, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<SearchMatch>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn batch<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, operations: Vec<BatchOperation>, ) -> Pin<Box<dyn Future<Output = FsResult<Vec<BatchResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn changes<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, after: Option<ChangeCursor>, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<Change>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait;
}
Expand description

Canonical asynchronous filesystem behavior shared by all backends.

Implementations must enforce the workspace and capabilities in each RequestContext and may be used through dyn FileSystem.

Required Methods§

Source

fn workspace_usage<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, ) -> Pin<Box<dyn Future<Output = FsResult<WorkspaceUsage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns logical and quota usage for the context’s workspace.

Source

fn stat<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: StatOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Returns metadata for a path.

Source

fn exists<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: StatOptions, ) -> Pin<Box<dyn Future<Output = FsResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Returns whether a path resolves to a visible node.

Source

fn read_dir<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<Node>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Returns one cursor-paginated page of direct directory children.

Source

fn tree<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: TreeOptions, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<TreeEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Returns one cursor-paginated page of a recursive tree traversal.

Source

fn mkdir<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: CreateOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Creates a directory.

Source

fn read<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: ReadOptions, ) -> Pin<Box<dyn Future<Output = FsResult<FileRead>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Opens a bounded-memory byte stream for a regular file.

Source

fn write<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, source: WriteSource, options: WriteOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Atomically creates or replaces a regular file from a byte stream.

Source

fn write_at<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, offset: u64, source: WriteSource, options: WriteOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Atomically writes streamed bytes beginning at a logical offset.

Source

fn append<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, source: WriteSource, options: WriteOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Atomically appends streamed bytes to a regular file.

Source

fn truncate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, length: u64, options: MutationOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Changes a regular file’s logical length.

Source

fn touch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: TouchOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Updates timestamps or creates an empty regular file.

Source

fn copy<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, from: &'life2 VirtualPath, to: &'life3 VirtualPath, options: CopyOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Copies a node within the context’s workspace.

Source

fn move_path<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, from: &'life2 VirtualPath, to: &'life3 VirtualPath, options: MoveOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Moves a node within the context’s workspace.

Source

fn remove<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: RemoveOptions, ) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Permanently removes a node.

Creates a symbolic link containing a relative or absolute virtual target.

Returns the stored target of a symbolic link without resolving it.

Source

fn trash<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, options: MutationOptions, ) -> Pin<Box<dyn Future<Output = FsResult<TrashEntry>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Moves a node into recoverable trash.

Source

fn list_trash<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<TrashEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns one cursor-paginated page of recoverable trash records.

Source

fn restore<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, trash: TrashId, destination: Option<&'life2 VirtualPath>, options: MutationOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Restores a recoverable trash record.

Source

fn purge<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, trash: TrashId, ) -> Pin<Box<dyn Future<Output = FsResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Permanently purges a recoverable trash record.

Source

fn set_attribute<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, key: &'life3 str, value: &'life4 [u8], options: MutationOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Sets an opaque custom attribute on a node.

Source

fn remove_attribute<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, path: &'life2 VirtualPath, key: &'life3 str, options: MutationOptions, ) -> Pin<Box<dyn Future<Output = FsResult<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Removes a custom attribute from a node.

Source

fn glob<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, pattern: &'life2 str, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<Node>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Returns nodes whose absolute paths match a virtual-path glob.

Source

fn find<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, query: FindQuery, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<Node>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns nodes matching bounded metadata predicates.

Source

fn search_content<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, query: ContentQuery, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<SearchMatch>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns bounded literal byte matches from regular files.

Source

fn batch<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, operations: Vec<BatchOperation>, ) -> Pin<Box<dyn Future<Output = FsResult<Vec<BatchResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes non-streaming operations atomically in request order.

Source

fn changes<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 RequestContext, after: Option<ChangeCursor>, page: PageRequest, ) -> Pin<Box<dyn Future<Output = FsResult<Page<Change>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns committed changes after an optional opaque cursor.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§