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
impl SequenceSync
Sourcepub async fn check_access(&self, access: &MemberAccess) -> Result<(), SyncError>
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
impl SequenceSync
Sourcepub async fn missing_store_key(
database: &StoreDatabase,
keys: &KeySession<StoreKeyring>,
) -> Result<Option<KeyId>, SyncError>
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).
Sourcepub async fn unlock(&self) -> Result<(), SyncError>
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).
Sourcepub async fn load_joined(
&self,
progress: Sender<Option<Progress<LoadStep>>>,
) -> Result<(), SyncError>
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
impl SequenceSync
Sourcepub async fn administer_admission(
self: &Arc<Self>,
__arg1: (StoreChange, CopyBox),
) -> Result<(), SyncError>
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
impl SequenceSync
Sourcepub async fn confirm_device_cut_off(
&self,
device: DeviceId,
) -> Result<(), SyncError>
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.
Sourcepub async fn holds_store(&self) -> Result<bool, SyncError>
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
impl SequenceSync
Sourcepub async fn clean_up_gone_devices_files(&self) -> Result<(), SyncError>
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
impl SequenceSync
Sourcepub async fn record_device_reset(
&self,
reset: DeviceReset,
records: &[OperationRecord],
) -> Result<(), SyncError>
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
impl SequenceSync
Sourcepub async fn accept_join(
&self,
invitation: &StorageInvitation,
) -> Result<(), SyncError>
pub async fn accept_join( &self, invitation: &StorageInvitation, ) -> Result<(), SyncError>
Complete provider acceptance before submitting a join request.
Sourcepub async fn leave_join(
&self,
invitation: &StorageInvitation,
) -> Result<(), SyncError>
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).
Sourcepub fn join_open(&self, request: &JoiningIdentity) -> bool
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).
Sourcepub async fn submit_join(
&self,
request: &JoiningIdentity,
) -> Result<bool, SyncError>
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).
Sourcepub async fn resend_join(
&self,
request: &JoiningIdentity,
) -> Result<bool, SyncError>
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).
Sourcepub fn access_lost(&self, error: &SyncError) -> bool
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).
Sourcepub async fn join_outcome(
&self,
request: &mut JoiningIdentity,
) -> Result<JoinOutcome, SyncError>
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
impl SequenceSync
Source§impl SequenceSync
impl SequenceSync
Sourcepub async fn replace_member_keys(
self: &Arc<Self>,
) -> Result<MemberIdentity, SyncError>
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
impl SequenceSync
Sourcepub async fn administer(
self: &Arc<Self>,
change: StoreChange,
) -> Result<(), SyncError>
pub async fn administer( self: &Arc<Self>, change: StoreChange, ) -> Result<(), SyncError>
Administrative requests retain their target across contention and reopening.
Sourcepub async fn administer_at(
self: &Arc<Self>,
change: StoreChange,
) -> Result<Option<Slot>, SyncError>
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.
Sourcepub async fn settle_operations(self: &Arc<Self>) -> Result<(), SyncError>
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.
Sourcepub async fn publish_creation(self: &Arc<Self>) -> Result<(), SyncError>
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.
Sourcepub async fn register_device(
self: &Arc<Self>,
name: String,
replaces: Option<DeviceId>,
) -> Result<(), SyncError>
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.
Sourcepub async fn snapshot(
self: &Arc<Self>,
audience: Audience,
) -> Result<Slot, SyncError>
pub async fn snapshot( self: &Arc<Self>, audience: Audience, ) -> Result<Slot, SyncError>
Capture the counted audience prefix, upload it, then claim its announcement.
Source§impl SequenceSync
impl SequenceSync
Sourcepub fn migration_operation(version: u32) -> Result<NewOperation, DbError>
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
impl SequenceSync
Sourcepub async fn reload_from_snapshot(&self) -> Result<(), SyncError>
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
impl SequenceSync
Sourcepub 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>
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.
Sourcepub fn reconnect(&self, storage: Arc<dyn Storage>) -> Self
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.
Sourcepub fn subscribe_progress(&self) -> ProgressWatch<LoadStep>
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.
Sourcepub async fn pass(&self) -> Result<SequenceStatus, SyncError>
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§
Auto Trait Implementations§
impl !RefUnwindSafe for SequenceSync
impl !UnwindSafe for SequenceSync
impl Freeze for SequenceSync
impl Send for SequenceSync
impl Sync for SequenceSync
impl Unpin for SequenceSync
impl UnsafeUnpin for SequenceSync
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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