pub enum FilesystemOperation {
Show 14 variants
CreateDirectory {
path: AbsolutePath,
parents: bool,
},
CreateDirectoryByInode {
parent_inode_id: InodeId,
display_name: DisplayName,
},
PutFile {
path: AbsolutePath,
content_ref: Option<ContentRef>,
inline_content: Option<Vec<u8>>,
behavior: DestinationBehavior,
expected_inode_id: Option<InodeId>,
expected_revision_no: Option<RevisionNo>,
},
CreateFileByInode {
parent_inode_id: InodeId,
display_name: DisplayName,
content_ref: Option<ContentRef>,
inline_content: Option<Vec<u8>>,
},
PutFileRevisionByInode {
inode_id: InodeId,
content_ref: Option<ContentRef>,
inline_content: Option<Vec<u8>>,
expected_revision_no: RevisionNo,
},
DeletePath {
path: AbsolutePath,
behavior: DeleteDirectoryBehavior,
expected_inode_id: Option<InodeId>,
},
DeleteByInode {
inode_id: InodeId,
expected_binding_generation: BindingGeneration,
behavior: DeleteDirectoryBehavior,
},
MovePath {
source_path: AbsolutePath,
destination_path: AbsolutePath,
precondition: DestinationPrecondition,
},
MoveByInode {
inode_id: InodeId,
expected_binding_generation: BindingGeneration,
destination_parent_inode_id: InodeId,
destination_display_name: DisplayName,
precondition: DestinationPrecondition,
},
CopyPath {
source_path: AbsolutePath,
destination_path: AbsolutePath,
precondition: DestinationPrecondition,
},
Undelete {
inode_id: InodeId,
deletion_seq: ChangeSeq,
destination_path: Option<AbsolutePath>,
},
RestoreRevision {
path: AbsolutePath,
source_revision_no: RevisionNo,
},
UpdateAttributes {
path: AbsolutePath,
set: BTreeMap<AttributeKey, AttributeValue>,
remove: Vec<AttributeKey>,
expected_inode_id: Option<InodeId>,
expected_attributes_revision_no: Option<AttributeRevisionNo>,
},
UpdateAccess {
path: AbsolutePath,
boundary: bool,
grants: AccessGrants,
expected_inode_id: Option<InodeId>,
expected_access_revision_no: Option<AccessRevisionNo>,
},
}Expand description
One filesystem operation.
Unknown fields are rejected, and fieldless variants require empty objects.
Variants§
CreateDirectory
Create one directory.
Fields
path: AbsolutePathAbsolute destination path, rejected when invalid or already bound.
CreateDirectoryByInode
Create a directory under an existing parent inode.
PutFile
Create or replace one file from uploaded or inline content.
Requires exactly one of content_ref and inline_content.
Fields
path: AbsolutePathAbsolute destination path; missing ancestors are created automatically.
content_ref: Option<ContentRef>Uploaded content covered by a token; mutually exclusive with inline_content.
behavior: DestinationBehaviorWhether an existing file may receive a new revision instead of causing a conflict.
expected_inode_id: Option<InodeId>With replace behavior, the request requires the path to contain this inode.
expected_revision_no: Option<RevisionNo>With replace behavior and an inode precondition, the request requires this content revision.
CreateFileByInode
Create a file with an unused name under an existing parent inode.
Requires exactly one of content_ref and inline_content.
Fields
display_name: DisplayNameNew file name.
content_ref: Option<ContentRef>Uploaded content covered by a token; mutually exclusive with inline_content.
PutFileRevisionByInode
Append a revision to a file inode if its current revision matches.
Requires exactly one of content_ref and inline_content.
Fields
content_ref: Option<ContentRef>Uploaded content covered by a token; mutually exclusive with inline_content.
expected_revision_no: RevisionNoCurrent revision required for the write.
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.
DeleteByInode
Delete an inode if its current binding matches.
Fields
expected_binding_generation: BindingGenerationBinding generation required for the delete.
behavior: DeleteDirectoryBehaviorWhether a non-empty directory may be tombstoned recursively.
MovePath
Move one path to another path.
Fields
source_path: AbsolutePathAbsolute source path that must resolve to a visible inode.
destination_path: AbsolutePathAbsolute destination whose parent must be visible and writable.
precondition: DestinationPreconditionReplacement behavior and optional destination state.
MoveByInode
Move an inode if its current binding matches.
Fields
expected_binding_generation: BindingGenerationBinding generation required for the move.
destination_display_name: DisplayNameNew name.
precondition: DestinationPreconditionReplacement behavior and optional destination state.
CopyPath
Copy one file path to another path.
Fields
source_path: AbsolutePathAbsolute source path that must resolve to a visible file.
destination_path: AbsolutePathAbsolute destination whose parent must be visible and writable.
precondition: DestinationPreconditionReplacement behavior and optional destination state.
Undelete
Restore the deletion identified by inode_id and deletion_seq.
Fields
deletion_seq: ChangeSeqObserved deletion sequence, which prevents cancelling a newer tombstone generation.
destination_path: Option<AbsolutePath>The restore destination, or None to use the recorded binding.
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.
UpdateAttributes
Write and remove attributes on the inode one path resolves to.
Fields
path: AbsolutePathAbsolute path that must resolve to a visible file or directory.
set: BTreeMap<AttributeKey, AttributeValue>The attributes to write, replacing values for matching keys and leaving other keys unchanged.
remove: Vec<AttributeKey>The attribute keys to remove, including duplicates that validation must reject.
expected_attributes_revision_no: Option<AttributeRevisionNo>With an inode precondition, the attribute revision that must still be current.
UpdateAccess
Replace the access row of the inode one path resolves to. The root path is a valid target.
Fields
path: AbsolutePathAbsolute path that must resolve to a visible file or directory.
grants: AccessGrantsThe inode’s complete direct grants after this update.
expected_access_revision_no: Option<AccessRevisionNo>With an inode precondition, the access revision that must still be current.
Implementations§
Source§impl FilesystemOperation
impl FilesystemOperation
Sourcepub const fn content_ref(&self) -> Option<&ContentRef>
pub const fn content_ref(&self) -> Option<&ContentRef>
Returns the content written by this operation, if any.