#[non_exhaustive]pub enum WriteOp {
CreateExclusive,
Replace,
Remove,
RenameWithinMount {
to: NsPath,
},
MakeDir,
}Expand description
An argument of the namespace verb write: not new verbs. The set is closed per release (non_exhaustive).
append and at_offset are reserved and not implemented: partial writes need a position model that survives a
remote hop and a Cas commit, and that is not settled. Do not simulate them with read-modify-write.
Except where noted, every op takes its data from the data argument of Backend::write (empty for ops that take
none; non-empty data on those is InvalidInput).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CreateExclusive
Create a file with data; fail with AlreadyExists if the name is taken. Not atomic as to content: a
concurrent reader can see a partial file. Use Replace if readers must never see one.
Replace
Make the file’s content exactly data, creating it if absent. Atomic where Caps::atomic_replace: a
temporary file in the same directory, fsync of the file, rename over the target, fsync of the directory, so
a reader sees the old content or the new content and a crash leaves one of them. Always yields a new file
(mode 0600 on Unix), so it also resets permission bits. Refused on a directory (IsADirectory).
Remove
Remove a file or an empty directory. Returns the version the entry had.
RenameWithinMount
Rename within this mount. The destination must not exist (AlreadyExists) and its name must not case-collide
with a sibling. Across mounts the namespace returns CrossMount.
MakeDir
Create one directory (not its parents: that would be NotFound). Mode 0700 on Unix.
Trait Implementations§
impl Eq for WriteOp
impl StructuralPartialEq for WriteOp
Auto Trait Implementations§
impl Forget for WriteOp
impl Freeze for WriteOp
impl Move for WriteOp
impl RefUnwindSafe for WriteOp
impl Send for WriteOp
impl Sync for WriteOp
impl Unpin for WriteOp
impl UnsafeUnpin for WriteOp
impl UnwindSafe for WriteOp
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,
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