pub struct CircleOperationJournal {
pub operation_id: CircleOperationId,
pub circle_id: CircleId,
pub intent: CircleOperationIntent,
pub operation: PreparedCircleOperation,
pub progress: CircleOperationProgress,
pub uploaded: BTreeSet<String>,
}Expand description
One Circle operation as it stands right now: the identity and prepared
operation held in circle_operations, the phase held beside them, and the
upload steps already completed, joined from circle_operation_uploads.
The three parts have different lifetimes on disk, which is why they are stored apart: the operation is written once, the phase changes on transitions, and the upload steps accumulate one row at a time.
Fields§
§operation_id: CircleOperationId§circle_id: CircleId§intent: CircleOperationIntent§operation: PreparedCircleOperation§progress: CircleOperationProgress§uploaded: BTreeSet<String>Implementations§
Source§impl CircleOperationJournal
impl CircleOperationJournal
Sourcepub fn ready(
operation_id: CircleOperationId,
circle_id: CircleId,
intent: CircleOperationIntent,
operation: PreparedCircleOperation,
) -> Self
pub fn ready( operation_id: CircleOperationId, circle_id: CircleId, intent: CircleOperationIntent, operation: PreparedCircleOperation, ) -> Self
A freshly prepared operation, with nothing uploaded yet.
pub fn circle_id(&self) -> CircleId
pub fn operation(&self) -> &PreparedCircleOperation
pub fn operation_mut(&mut self) -> &mut PreparedCircleOperation
Sourcepub fn validate_uploaded(&self) -> Result<(), CircleJournalError>
pub fn validate_uploaded(&self) -> Result<(), CircleJournalError>
Refuse an upload step that names no object in this operation. Every completed step must name one, so a joined upload row that does not is a journal that contradicts itself.
Sourcepub fn candidate_owned_objects(
&self,
) -> Result<BTreeSet<ExactObjectRef>, CircleJournalError>
pub fn candidate_owned_objects( &self, ) -> Result<BTreeSet<ExactObjectRef>, CircleJournalError>
The objects of this operation that remote_objects holds a record for:
its commit’s candidate-exclusive graph, plus the commit and the Store
head published with it.
The rest of an operation’s objects — its control head, roster and metadata — are shared Circle objects the candidate does not own exclusively, so completing their upload step has no candidate record to mark. This names that set so a caller dispatches on it rather than discovering it by a lookup that comes back empty.
Sourcepub fn closed_remote_objects(
&self,
prepared_objects: &BTreeMap<String, PreparedExactObject>,
) -> Result<Vec<ClosedRemoteObject>, CircleJournalError>
pub fn closed_remote_objects( &self, prepared_objects: &BTreeMap<String, PreparedExactObject>, ) -> Result<Vec<ClosedRemoteObject>, CircleJournalError>
The candidate graph this operation would activate, closed over the stored bytes of its objects.
The bytes come from the caller because this value holds only references to them: the durable copy is in the payload spool, and the caller that has just written or read it supplies what it read.
pub fn state(&self) -> CircleOperationState
Sourcepub fn begin_discard(&mut self) -> Result<(), CircleJournalError>
pub fn begin_discard(&mut self) -> Result<(), CircleJournalError>
Enter cleanup after a verified nonactivation proof was accepted. Legal from any state whose candidate has not activated — a ready or blocked initial candidate, or a finalization candidate. A candidate that already won its slot has no journal row in these states, so no path reaches here.
pub fn is_discarding(&self) -> bool
pub fn block( &mut self, block: CircleOperationBlock, ) -> Result<(), CircleJournalError>
Sourcepub fn unblock(&mut self) -> Result<(), CircleJournalError>
pub fn unblock(&mut self) -> Result<(), CircleJournalError>
Return a blocked operation to the phase captured when it blocked, so it re-enters the idempotent publish pipeline against its exact retained operation.
pub fn wait_for_close_responses(&mut self) -> Result<(), CircleJournalError>
Sourcepub fn begin_finalization(
&mut self,
operation: PreparedCircleOperation,
) -> Result<(), CircleJournalError>
pub fn begin_finalization( &mut self, operation: PreparedCircleOperation, ) -> Result<(), CircleJournalError>
Install the freshly prepared finalization operation, replacing the one that reached its close.
This is the one point in an operation’s life where the prepared operation changes: the finalization commit is a new candidate graph. Its steps are named for the object kinds they carry, so they repeat the names the superseded operation used — which is why the completed uploads go with the operation they belonged to.
pub fn is_finalizing(&self) -> bool
pub fn is_publishable(&self) -> bool
pub fn commit(&self) -> Result<StoreBatchCommit, CircleJournalError>
pub fn validate_identity(&self) -> Result<(), CircleJournalError>
pub fn kind(&self) -> CircleOperationKind
Trait Implementations§
Source§impl Clone for CircleOperationJournal
impl Clone for CircleOperationJournal
Source§fn clone(&self) -> CircleOperationJournal
fn clone(&self) -> CircleOperationJournal
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CircleOperationJournal
impl Debug for CircleOperationJournal
Source§impl<'de> Deserialize<'de> for CircleOperationJournal
impl<'de> Deserialize<'de> for CircleOperationJournal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CircleOperationJournal
impl PartialEq for CircleOperationJournal
Source§impl Serialize for CircleOperationJournal
impl Serialize for CircleOperationJournal
impl Eq for CircleOperationJournal
impl StructuralPartialEq for CircleOperationJournal
Auto Trait Implementations§
impl !Freeze for CircleOperationJournal
impl RefUnwindSafe for CircleOperationJournal
impl Send for CircleOperationJournal
impl Sync for CircleOperationJournal
impl Unpin for CircleOperationJournal
impl UnsafeUnpin for CircleOperationJournal
impl UnwindSafe for CircleOperationJournal
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.