FileSystem trait
Every backend implements the FileSystem async trait in
fslite-core (opens in a new tab).
There are 28 methods in 1.0; new methods may be added in 0.x with a
default implementation when feasible.
The *Options shape for each method is #[non_exhaustive], so you
can construct via T::default() and .with(...) setters — adding a
field to a future release won't break existing callers.
For the exact HTTP status / CLI mapping each error returns, see Error codes. For the capability→method gating, see Embedding › Capability gating.
Method reference
| Method | Purpose | *Options | Required Capability |
|---|---|---|---|
append | Atomically appends streamed bytes to a regular file. | WriteOptions | Write |
batch | Executes non-streaming operations atomically. | n/a (vec of ops) | per-operation |
changes | Returns committed changes after an optional cursor. | PageRequest | Read |
copy | Copies a node within the workspace. | CopyOptions | Write |
create_workspace (inherent) | Creates a new isolated workspace. | WorkspaceOptions | WorkspaceAdmin |
delete_workspace (inherent) | Deletes a workspace and its data. | n/a | WorkspaceAdmin |
exists | Tests whether a path resolves to a visible node. | StatOptions | Read |
find | Returns nodes matching bounded metadata predicates. | FindQuery + PageRequest | Read |
glob | Returns nodes whose paths match a virtual-path glob. | PageRequest | Read |
list_trash | Lists recoverable trash records (paginated). | PageRequest | Read |
mkdir | Creates a directory. | CreateOptions | Write |
move_path | Moves a node within the workspace. | MoveOptions | Write |
purge | Permanently purges a trash record. | n/a (trash id) | Delete |
read | Opens a bounded-memory byte stream for a regular file. | ReadOptions | Read |
read_dir | One cursor-paginated page of a directory's children. | PageRequest | Read |
read_link | Returns a symbolic link's stored target. | n/a | Read |
remove | Permanently removes a node. | RemoveOptions | Delete |
remove_attribute | Removes a custom attribute from a node. | MutationOptions | Write |
restore | Restores a recoverable trash record. | MutationOptions (+ optional destination) | TrashRestore |
search_content | Returns literal byte matches inside regular files. | ContentQuery + PageRequest | Read |
set_attribute | Sets a custom attribute on a node. | MutationOptions | Write |
stat | Returns metadata for one path. | StatOptions | Read |
symlink | Creates a symbolic link. | CreateOptions | Write |
touch | Updates timestamps or creates an empty regular file. | TouchOptions | Write |
trash | Moves a node into recoverable trash. | MutationOptions | TrashRestore |
tree | Recursively enumerates a subtree (paginated). | TreeOptions + PageRequest | Read |
truncate | Changes a regular file's logical length. | MutationOptions | Write |
workspace_usage | Returns the workspace's byte/node usage and limits. | n/a | Read |
write | Atomically creates or replaces a regular file. | WriteOptions | Write |
write_at | Atomically writes bytes at a logical offset. | WriteOptions | Write |
Method shapes
The full signatures live on
docs.rs (opens in a new tab);
each *Options type is also linked from there. In your editor,
cargo doc --workspace --open renders the same content locally.
Inherent methods (create_workspace, delete_workspace) live on
SqliteFileSystem rather than the trait because they're storage-
shaped rather than file-shaped — every backend has a different answer
for "create one of me."