Skip to main content

FilesystemOperation

Enum FilesystemOperation 

Source
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: AbsolutePath

Absolute destination path, rejected when invalid or already bound.

§parents: bool

Whether to create missing ancestor directories while requiring the final component to be new.

§

CreateDirectoryByInode

Create a directory under an existing parent inode.

Fields

§parent_inode_id: InodeId

Parent directory.

§display_name: DisplayName

New directory name.

§

PutFile

Create or replace one file from uploaded or inline content. Requires exactly one of content_ref and inline_content.

Fields

§path: AbsolutePath

Absolute destination path; missing ancestors are created automatically.

§content_ref: Option<ContentRef>

Uploaded content covered by a token; mutually exclusive with inline_content.

§inline_content: Option<Vec<u8>>

Complete file bytes as base64; mutually exclusive with content_ref.

§behavior: DestinationBehavior

Whether 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

§parent_inode_id: InodeId

Parent directory.

§display_name: DisplayName

New file name.

§content_ref: Option<ContentRef>

Uploaded content covered by a token; mutually exclusive with inline_content.

§inline_content: Option<Vec<u8>>

Complete file bytes as base64; mutually exclusive with content_ref.

§

PutFileRevisionByInode

Append a revision to a file inode if its current revision matches. Requires exactly one of content_ref and inline_content.

Fields

§inode_id: InodeId

File to update.

§content_ref: Option<ContentRef>

Uploaded content covered by a token; mutually exclusive with inline_content.

§inline_content: Option<Vec<u8>>

Complete file bytes as base64; mutually exclusive with content_ref.

§expected_revision_no: RevisionNo

Current revision required for the write.

§

DeletePath

Delete one path.

Fields

§path: AbsolutePath

Absolute path that must resolve to a visible inode.

§behavior: DeleteDirectoryBehavior

Whether a non-empty directory may be tombstoned recursively.

§expected_inode_id: Option<InodeId>

The inode that the path must still resolve to before deletion.

§

DeleteByInode

Delete an inode if its current binding matches.

Fields

§inode_id: InodeId

Inode to delete.

§expected_binding_generation: BindingGeneration

Binding generation required for the delete.

§behavior: DeleteDirectoryBehavior

Whether a non-empty directory may be tombstoned recursively.

§

MovePath

Move one path to another path.

Fields

§source_path: AbsolutePath

Absolute source path that must resolve to a visible inode.

§destination_path: AbsolutePath

Absolute destination whose parent must be visible and writable.

§precondition: DestinationPrecondition

Replacement behavior and optional destination state.

§

MoveByInode

Move an inode if its current binding matches.

Fields

§inode_id: InodeId

Inode to move.

§expected_binding_generation: BindingGeneration

Binding generation required for the move.

§destination_parent_inode_id: InodeId

Destination directory.

§destination_display_name: DisplayName

New name.

§precondition: DestinationPrecondition

Replacement behavior and optional destination state.

§

CopyPath

Copy one file path to another path.

Fields

§source_path: AbsolutePath

Absolute source path that must resolve to a visible file.

§destination_path: AbsolutePath

Absolute destination whose parent must be visible and writable.

§precondition: DestinationPrecondition

Replacement behavior and optional destination state.

§

Undelete

Restore the deletion identified by inode_id and deletion_seq.

Fields

§inode_id: InodeId

Deleted inode to make reachable again.

§deletion_seq: ChangeSeq

Observed 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: AbsolutePath

Absolute path that must resolve to a visible file.

§source_revision_no: RevisionNo

Existing 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: AbsolutePath

Absolute 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_inode_id: Option<InodeId>

The inode that the path must still resolve to before the update.

§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: AbsolutePath

Absolute path that must resolve to a visible file or directory.

§boundary: bool

Whether the directory stops inheritance from its ancestors.

§grants: AccessGrants

The inode’s complete direct grants after this update.

§expected_inode_id: Option<InodeId>

The inode that the path must still resolve to before the update.

§expected_access_revision_no: Option<AccessRevisionNo>

With an inode precondition, the access revision that must still be current.

Implementations§

Source§

impl FilesystemOperation

Source

pub const fn content_ref(&self) -> Option<&ContentRef>

Returns the content written by this operation, if any.

Trait Implementations§

Source§

impl Clone for FilesystemOperation

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FilesystemOperation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FilesystemOperation

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for FilesystemOperation

Source§

impl PartialEq for FilesystemOperation

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for FilesystemOperation

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FilesystemOperation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.