pub enum FilesystemOperation {
CreateDirectory {
path: AbsolutePath,
parents: bool,
},
PutFile {
path: AbsolutePath,
content_ref: ContentRef,
behavior: DestinationBehavior,
expected_revision_no: Option<RevisionNo>,
},
DeletePath {
path: AbsolutePath,
behavior: DeleteDirectoryBehavior,
expected_inode_id: Option<InodeId>,
},
MovePath {
from_path: AbsolutePath,
to_path: AbsolutePath,
behavior: DestinationBehavior,
},
CopyPath {
from_path: AbsolutePath,
to_path: AbsolutePath,
behavior: DestinationBehavior,
},
Undelete {
inode_id: InodeId,
deleted_at_seq: ChangeSeq,
path: Option<AbsolutePath>,
},
RestoreRevision {
path: AbsolutePath,
source_revision_no: RevisionNo,
},
}Expand description
One path-oriented filesystem operation.
Variants§
CreateDirectory
Create one directory.
Fields
path: AbsolutePathAbsolute destination path, rejected when invalid or already bound.
PutFile
Create or replace one file with an already-durable content ref.
Fields
path: AbsolutePathAbsolute destination path; missing ancestors are created automatically.
content_ref: ContentRefImmutable bytes that must be covered by a valid preparation proof.
behavior: DestinationBehaviorWhether an existing file may receive a new revision instead of causing a conflict.
expected_revision_no: Option<RevisionNo>When set (with replace behavior), the put applies only while
the file’s current revision is still this one; a raced write
fails the request instead of silently stacking on it, and a
missing file answers path_not_found.
DeletePath
Delete one path.
Fields
path: AbsolutePathAbsolute path that must resolve to a visible inode.
behavior: DeleteDirectoryBehaviorWhether a non-empty directory may be tombstoned recursively.
MovePath
Move one path to another path.
Fields
from_path: AbsolutePathAbsolute source path that must resolve to a visible inode.
to_path: AbsolutePathAbsolute destination whose parent must be visible and writable.
behavior: DestinationBehaviorWhether an existing destination file may be replaced.
CopyPath
Copy one file path to another path.
Fields
from_path: AbsolutePathAbsolute source path that must resolve to a visible file.
to_path: AbsolutePathAbsolute destination whose parent must be visible and writable.
behavior: DestinationBehaviorWhether an existing destination file may receive a copied revision.
Undelete
Recover a deleted file or subtree: revoke the deletion of
inode_id recorded at deleted_at_seq (both reported by the
delete and by the change feed) and re-bind it. Answers
not_deleted when that generation is not the live one, so a stale
request never cancels a later delete.
Fields
deleted_at_seq: ChangeSeqObserved deletion sequence, which prevents cancelling a newer tombstone generation.
path: Option<AbsolutePath>Absolute destination path whose parent must be visible and whose name must be absent. Absent means restore in place: re-bind under the parent and name the deletion recorded, anchored on the parent’s identity rather than any remembered spelling, so the entry lands correctly even when ancestors were renamed since. A deletion that recorded no binding needs the explicit path.
RestoreRevision
Restore an older revision as the current revision for a path.
Fields
path: AbsolutePathAbsolute path that must resolve to a visible file.
source_revision_no: RevisionNoExisting historical revision whose content will be copied into a new current revision.
Trait Implementations§
Source§impl Clone for FilesystemOperation
impl Clone for FilesystemOperation
Source§fn clone(&self) -> FilesystemOperation
fn clone(&self) -> FilesystemOperation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more