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
The operation language a commit is written in, owned by loonfs-api and
used here unchanged.
There is one spelling of a pre-planning operation across the workspace:
what a client sends is what the planner matches on, so no surface
translates between two versions of the same language. The durable
fingerprint preimage is a separate, frozen spelling, and the planner’s
operation_fingerprint_input is the only place this one is renamed
into it.
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 moreSource§impl Debug for FilesystemOperation
impl Debug for FilesystemOperation
Source§impl<'de> Deserialize<'de> for FilesystemOperation
impl<'de> Deserialize<'de> for FilesystemOperation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FilesystemOperation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FilesystemOperation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for FilesystemOperation
Source§impl PartialEq for FilesystemOperation
impl PartialEq for FilesystemOperation
Source§impl Serialize for FilesystemOperation
impl Serialize for FilesystemOperation
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for FilesystemOperation
Auto Trait Implementations§
impl Freeze for FilesystemOperation
impl RefUnwindSafe for FilesystemOperation
impl Send for FilesystemOperation
impl Sync for FilesystemOperation
impl Unpin for FilesystemOperation
impl UnsafeUnpin for FilesystemOperation
impl UnwindSafe for FilesystemOperation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more