pub enum BatchOp {
Write {
path: PathBuf,
bytes: Vec<u8>,
},
CreateNew {
path: PathBuf,
bytes: Vec<u8>,
},
}Expand description
One staged op of an OrderedBatch. Paths are root-relative, joined
onto the root at apply time, exactly as
FileOp’s are.
Variants§
Write
Write bytes to path, creating it (and any missing parent directory)
or replacing it wholesale — through Storage::replace, the backend’s
own protocol, override included, so the atomicity promise is exactly
the backend’s
(atomic_replace). Its
durability is the tier’s, batched with everything else’s.
CreateNew
Create path, which must not already exist, holding bytes — through
Storage::create_new, so the exclusivity is the backend’s own.
An occupied path surfaces as
AlreadyExists and stops the
apply where it stands; what the collision means — a race lost
harmlessly to a writer producing the same bytes, or a real conflict —
is the caller’s to decide, because only the caller knows whether its
names promise their contents.