Reference
FileSystem trait

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

MethodPurpose*OptionsRequired Capability
appendAtomically appends streamed bytes to a regular file.WriteOptionsWrite
batchExecutes non-streaming operations atomically.n/a (vec of ops)per-operation
changesReturns committed changes after an optional cursor.PageRequestRead
copyCopies a node within the workspace.CopyOptionsWrite
create_workspace (inherent)Creates a new isolated workspace.WorkspaceOptionsWorkspaceAdmin
delete_workspace (inherent)Deletes a workspace and its data.n/aWorkspaceAdmin
existsTests whether a path resolves to a visible node.StatOptionsRead
findReturns nodes matching bounded metadata predicates.FindQuery + PageRequestRead
globReturns nodes whose paths match a virtual-path glob.PageRequestRead
list_trashLists recoverable trash records (paginated).PageRequestRead
mkdirCreates a directory.CreateOptionsWrite
move_pathMoves a node within the workspace.MoveOptionsWrite
purgePermanently purges a trash record.n/a (trash id)Delete
readOpens a bounded-memory byte stream for a regular file.ReadOptionsRead
read_dirOne cursor-paginated page of a directory's children.PageRequestRead
read_linkReturns a symbolic link's stored target.n/aRead
removePermanently removes a node.RemoveOptionsDelete
remove_attributeRemoves a custom attribute from a node.MutationOptionsWrite
restoreRestores a recoverable trash record.MutationOptions (+ optional destination)TrashRestore
search_contentReturns literal byte matches inside regular files.ContentQuery + PageRequestRead
set_attributeSets a custom attribute on a node.MutationOptionsWrite
statReturns metadata for one path.StatOptionsRead
symlinkCreates a symbolic link.CreateOptionsWrite
touchUpdates timestamps or creates an empty regular file.TouchOptionsWrite
trashMoves a node into recoverable trash.MutationOptionsTrashRestore
treeRecursively enumerates a subtree (paginated).TreeOptions + PageRequestRead
truncateChanges a regular file's logical length.MutationOptionsWrite
workspace_usageReturns the workspace's byte/node usage and limits.n/aRead
writeAtomically creates or replaces a regular file.WriteOptionsWrite
write_atAtomically writes bytes at a logical offset.WriteOptionsWrite

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."