pub enum PutPlan {
Write(Record),
Conflict(Box<Conflict>),
NotFound,
Rejected(&'static str),
}Expand description
What a store must do for a put. Decided with the store’s current record
in hand, inside its OCC critical section.
Variants§
Write(Record)
Persist exactly this record, then return
PutResult::Committed(record.revision). On recreation the revision was
re-stamped; ancestors are always already folded.
Conflict(Box<Conflict>)
Persist nothing; return PutResult::Conflict.
NotFound
Persist nothing; return Err(CoreError::NotFound(key)).
Rejected(&'static str)
The record may not be written through this path; return
Err(CoreError::Invalid(reason.to_string())) (the daemon answers 400,
not 500; gonzalo#299). Only consumer plan_put produces this: for a
RecordKind::Tombstone record (deletes go through Store::delete_as,
and replication writes tombstones through put_raw), and for a create
over a manifest tombstone, which would discard its restore window.