Skip to main content

SequenceSync

Struct SequenceSync 

Source
pub struct SequenceSync { /* private fields */ }
Expand description

Owns sequence progress. App commits use the database independently; every publisher shares this owner’s serialization and actual blocked state.

Implementations§

Source§

impl SequenceSync

Source

pub async fn check_access(&self, access: &MemberAccess) -> Result<(), SyncError>

Refuse access as this member’s own where history would refuse recording it (format.md D6). A restore checks before registering its device, so a member who could never record the access it signed in with leaves no device behind (§20.9).

Source§

impl SequenceSync

Source

pub async fn missing_store_key( database: &StoreDatabase, keys: &KeySession<StoreKeyring>, ) -> Result<Option<KeyId>, SyncError>

The store key that sealed this installation’s newest applied original while custody holds no store key: syncing needs it unlocked first (§12.4).

Source

pub async fn unlock(&self) -> Result<(), SyncError>

Open this member’s store keys from their copies in storage, keep them in custody and read forward, without sending (§12.1, E5). Loading’s steps go to subscribe_progress as they run (§13.4).

Source

pub async fn load_joined( &self, progress: Sender<Option<Progress<LoadStep>>>, ) -> Result<(), SyncError>

The first load of a store a join published once it found its admission: read forward from nothing with the keys its copies opened, reporting loading’s steps into progress, then stop for good if the history refused that admission (§13.2).

Source§

impl SequenceSync

Source

pub async fn administer_admission( self: &Arc<Self>, __arg1: (StoreChange, CopyBox), ) -> Result<(), SyncError>

Admit a member as an approved join request does, with the member’s own copy of the circle key the entry introduces, for a test that admits without a join: the pair admitting returns.

Source§

impl SequenceSync

Source

pub async fn confirm_device_cut_off( &self, device: DeviceId, ) -> Result<(), SyncError>

The person did the provider step for device, a lost device of the owner’s (§14.2): nothing it sent can land any more. Every account its invite shares named that nothing intends now is taken back by a request of its own, which runs after this call and so after anything the device’s grants did: its grant may have landed after this device’s earlier revocation of the account. An account a member or an open invite uses stays shared.

Refused with CutOffRefused, naming why: NoAccountShared on S3, NotStoreOwner unless this device’s member holds the store’s account, and DeviceNotGone unless the applied history has device gone for good, which the next pass may bring. Fails with ProviderRequestRunning, changing nothing, while a request to one of those accounts runs; the call is made again once it ends.

Source

pub async fn holds_store(&self) -> Result<bool, SyncError>

Whether this device’s member reaches storage through the account that holds the store (§20.9): only their devices share it and take sharing back, so only they can confirm a device cut off. Reads the sequence forward first, so it answers for the history as it stands.

Source§

impl SequenceSync

Source

pub async fn clean_up_gone_devices_files(&self) -> Result<(), SyncError>

The app’s cleanup of the files of devices gone for good (§17.10): for every such device this device is responsible for, end the uploads it left and delete each snapshot body of its no announcement names (§16.6), list its file folder again, then delete every file found that nothing refers to and every other device has seen lose its last name; later passes delete the rest. It returns once that is done, or with the failure that stopped it, which the operation also records. A device gone for good later uploads only files that can never be referred to, so running this at any time is safe.

Source§

impl SequenceSync

Source

pub async fn record_device_reset( &self, reset: DeviceReset, records: &[OperationRecord], ) -> Result<(), SyncError>

Carry a discarded installation’s provider obligations after loading storage under its replacement id. Invites use their existing expiry cleanup; retained member access still follows the applied history; detection runs keep their records for a later detection or connection to clean up after (§20.7).

Source§

impl SequenceSync

Source

pub async fn accept_join( &self, invitation: &StorageInvitation, ) -> Result<(), SyncError>

Complete provider acceptance before submitting a join request.

Source

pub async fn leave_join( &self, invitation: &StorageInvitation, ) -> Result<(), SyncError>

Take back accept_join’s provider acceptance, for a join cancelled before its request was sent; one already taken back is done (§13.2).

Source

pub fn join_open(&self, request: &JoiningIdentity) -> bool

Whether the invite still lets the request be sent first now: no first request goes out once the invite has ended by this device’s clock (§13.2).

Source

pub async fn submit_join( &self, request: &JoiningIdentity, ) -> Result<bool, SyncError>

Publish the recorded immutable request after provider acceptance. false when the invite ended before it was sent: its marker holds the request’s path, and the join ends as declined (§13.2). false too when the join’s access to the location is gone (access_lost).

Source

pub async fn resend_join( &self, request: &JoiningIdentity, ) -> Result<bool, SyncError>

Send the request of a join that recorded its send in an earlier call and may have stopped before the create, while the invite is open. false when the join’s access to the location is gone (access_lost).

Source

pub fn access_lost(&self, error: &SyncError) -> bool

Whether error says the access a join was shown to hold, to the invite’s own location, is gone: the provider refused the account or found the location missing, or an S3 key the invite carries was deleted or disabled. A sign-in the provider rejects is no such answer: the person signs in again (§13.2).

Source

pub async fn join_outcome( &self, request: &mut JoiningIdentity, ) -> Result<JoinOutcome, SyncError>

Inspect the slots after the invite for copies routed to the request’s pair; once they open a store key, in the admission that carries them, record that and keep the keys in custody: the join has found its admission and publishes the store. Copies alone do not admit: the published store’s first load applies the admission, and stops the store if its history refused it (§13.2). A check reports nothing to subscribe_progress while it scans for the copies: the scan is part of the wait. Once they open, it reports the scan as loading’s first step (E10).

A check that could not reach the shared location before the keys open has lost the join’s access, and ends it as an absent request does (access_lost, JoinScan.outcome); one of a join whose keys already opened is the published store’s lost access, which is no ending.

Source§

impl SequenceSync

Source

pub async fn rotate_key( self: &Arc<Self>, audience: Audience, ) -> Result<(), SyncError>

Replace an audience key through the administrative journal.

Source

pub async fn remove_circle_member( self: &Arc<Self>, circle: CircleId, member: MemberId, ) -> Result<(), SyncError>

Remove member from circle, replacing the circle’s key in the same entry (§15.8), through the administrative journal.

Source§

impl SequenceSync

Source

pub async fn replace_member_keys( self: &Arc<Self>, ) -> Result<MemberIdentity, SyncError>

Replace this member’s own pair and return the installed identity. App writes wait with MemberKeysChanging until the binding applies and identity and restore-code custody finish, or replacement fails (§12.3, E9).

Source§

impl SequenceSync

Source

pub async fn administer( self: &Arc<Self>, change: StoreChange, ) -> Result<(), SyncError>

Administrative requests retain their target across contention and reopening.

Source

pub async fn administer_at( self: &Arc<Self>, change: StoreChange, ) -> Result<Option<Slot>, SyncError>

Administer change, answering the slot its entry landed at, or None when the applied state already had it. A store’s creation lands at slot 1, though its key copy lands after it.

Source

pub async fn settle_operations(self: &Arc<Self>) -> Result<(), SyncError>

Catch up, settle this device’s open claim and run its journaled operations to their ends, as every new operation does first (§11.4). A storage setup a crash cut past its point of no return finishes a creation this way.

Source

pub async fn publish_creation(self: &Arc<Self>) -> Result<(), SyncError>

Send the slot 1 a store’s creation decided, as the attempt it kept, and settle it (§10.3). Answers StoreExists once another device’s bytes hold slot 1, and nothing when the creation is already published.

Source

pub async fn register_device( self: &Arc<Self>, name: String, replaces: Option<DeviceId>, ) -> Result<(), SyncError>

Register this installation for its member once the applied history binds the member’s current pair (§13). replaces names this member’s earlier installation that a reset supersedes.

Source

pub async fn snapshot( self: &Arc<Self>, audience: Audience, ) -> Result<Slot, SyncError>

Capture the counted audience prefix, upload it, then claim its announcement.

Source

pub async fn reset( self: &Arc<Self>, audience: Audience, ) -> Result<(), SyncError>

Publish a prepared reset and activate it through the same operation journal.

Source

pub async fn raise_schema( self: &Arc<Self>, audience: Audience, version: u32, ) -> Result<(), SyncError>

Publish the captured breaking migration and activate its audience version.

Source§

impl SequenceSync

Source

pub fn migration_operation(version: u32) -> Result<NewOperation, DbError>

Supply to DatabaseBuilder::migration_operation at the composition root: the breaking migration’s version commits with its schema, and passes raise each audience it captured to that version (§18.3).

Source§

impl SequenceSync

Source

pub async fn reload_from_snapshot(&self) -> Result<(), SyncError>

Reload readable audiences from selected snapshots and retained slots, preserving waiting writes. Repeated calls resume the same journal (§16.5).

Source§

impl SequenceSync

Source

pub async fn open( database: StoreDatabase, storage: Arc<dyn Storage>, directory: StoreDir, device: DeviceId, keys: Arc<KeySession<StoreKeyring>>, member: Arc<KeySession<MemberIdentity>>, person: Arc<PersonEntries>, state: Arc<SequenceState>, clock: ClockRef, ids: IdSourceRef, waits: Arc<RetryWaits>, files: Files, ) -> Result<Self, SyncError>

Reconstruct historical bindings once from committed originals. It performs no provider request and grants no sending authority.

Source

pub fn reconnect(&self, storage: Arc<dyn Storage>) -> Self

Use candidate credentials while retaining this installation’s exact progress and serialization. Failed setup can keep the old provider without replaying history the candidate already applied.

Source

pub fn subscribe_progress(&self) -> ProgressWatch<LoadStep>

The steps unlock reports as it loads the store from storage, each with how much of it is done (§13.4). Passes report none.

Source

pub async fn pass(&self) -> Result<SequenceStatus, SyncError>

Reach the current read end, publish this pass’s captured eligible queue, then perform the effects of its applied administrative state.

Trait Implementations§

Source§

impl Clone for SequenceSync

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more

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
§

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> 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<T> ErasedDestructor for T
where T: 'static,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

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

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 = !

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

fn try_from(value: U) -> Result<T, !>

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