Skip to main content

CircleOperationJournal

Struct CircleOperationJournal 

Source
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

Source

pub fn ready( operation_id: CircleOperationId, circle_id: CircleId, intent: CircleOperationIntent, operation: PreparedCircleOperation, ) -> Self

A freshly prepared operation, with nothing uploaded yet.

Source

pub fn circle_id(&self) -> CircleId

Source

pub fn operation(&self) -> &PreparedCircleOperation

Source

pub fn operation_mut(&mut self) -> &mut PreparedCircleOperation

Source

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.

Source

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.

Source

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.

Source

pub fn state(&self) -> CircleOperationState

Source

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.

Source

pub fn is_discarding(&self) -> bool

Source

pub fn block( &mut self, block: CircleOperationBlock, ) -> Result<(), CircleJournalError>

Source

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.

Source

pub fn wait_for_close_responses(&mut self) -> Result<(), CircleJournalError>

Source

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.

Source

pub fn is_finalizing(&self) -> bool

Source

pub fn is_publishable(&self) -> bool

Source

pub fn commit(&self) -> Result<StoreBatchCommit, CircleJournalError>

Source

pub fn validate_identity(&self) -> Result<(), CircleJournalError>

Source

pub fn kind(&self) -> CircleOperationKind

Trait Implementations§

Source§

impl Clone for CircleOperationJournal

Source§

fn clone(&self) -> CircleOperationJournal

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CircleOperationJournal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CircleOperationJournal

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CircleOperationJournal

Source§

fn eq(&self, other: &CircleOperationJournal) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CircleOperationJournal

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for CircleOperationJournal

Source§

impl StructuralPartialEq for CircleOperationJournal

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,