Skip to main content

SyncLoopHandle

Struct SyncLoopHandle 

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

Manages the background sync loop and provides access to sync components.

Implementations§

Source§

impl SyncLoopHandle

Source

pub fn new( components: SyncComponents, clock: ClockRef, config: Config, observer: Option<Arc<dyn BlobTransitionObserver>>, open_guard: Arc<StoreOpenGuard>, status_tx: Sender<SyncLoopStatus>, eager_cache_status_tx: Sender<EagerCacheFillStatus>, runtime: Option<PreparedSyncLoopRuntime>, ) -> Self

Source

pub fn activate(&self)

Release a prepared loop to begin its normal startup delay and cycles.

Source

pub fn provider_requests(&self) -> Option<Arc<dyn ProviderRequests>>

The provider-operation counter of the home this loop works through, so a run driven from outside the loop — an owner-side device-join step — can report each stage’s count beside its wall time.

Source

pub fn is_running(&self) -> bool

Whether the background sync thread is running.

Source

pub fn stop(&self)

Request loop shutdown and join the sync thread.

Source

pub fn trigger(&self)

Signal the sync loop to run a cycle immediately.

Full means a trigger is already pending — our request collapses into the existing one, which is exactly what the capacity-1 channel is for. Closed means the loop is gone, so the trigger is moot.

Source

pub fn cancel_eager_cache_fill(&self)

Stop the post-open CacheEager fill without stopping cloud sync.

Source

pub async fn discard_blocked_write( &self, write_id: WriteId, ) -> Result<Vec<WriteId>, StoreError>

Source

pub async fn members(&self) -> Result<Vec<MemberInfo>, MembershipOpsError>

Source

pub async fn membership_conflict( &self, ) -> Result<Option<MembershipConflictInfo>, MembershipOpsError>

Source

pub async fn restore_membership( &self, ) -> Result<StoreRestoreMembership, MembershipOpsError>

Source

pub fn host_write_blob_staging(&self, runtime: Handle) -> HostWriteBlobStaging

Source

pub async fn propose_device_exclusion( &self, device_id: StoreDeviceId, ) -> Result<StoreDeviceExclusionProposalRef, StoreDeviceExclusionError>

Source

pub async fn cancel_device_exclusion( &self, proposal: &StoreDeviceExclusionProposalRef, ) -> Result<(), StoreDeviceExclusionError>

Source

pub async fn finalize_device_exclusion( &self, proposal: &StoreDeviceExclusionProposalRef, ) -> Result<(), StoreDeviceExclusionError>

Source

pub async fn begin_owner_promotion( &self, device_id: StoreDeviceId, ) -> Result<OwnerPromotionRequest, OwnerPromotionError>

Source

pub async fn accept_owner_promotion( &self, request: OwnerPromotionRequest, ) -> Result<OwnerPromotionAcceptance, OwnerPromotionError>

Source

pub async fn finalize_owner_promotion( &self, acceptance: OwnerPromotionAcceptance, ) -> Result<(), OwnerPromotionError>

Source

pub async fn begin_device_join_bundle( &self, member_pubkey: &str, ) -> Result<DeviceJoinOfferBundle, DeviceJoinTransportError>

Source

pub async fn drive_device_join( &self, bundle: &DeviceJoinOfferBundle, policy: DeviceJoinApprovalPolicy<'_>, access_administrator: Option<&dyn DeviceProviderAccessAdministrator>, on_progress: &(dyn Fn(AdmittingDeviceJoinProgress) + Send + Sync), timing: DeviceJoinTransportTiming, ) -> Result<DeviceJoinDriveOutcome, DeviceJoinTransportError>

Source

pub async fn abandon_device_join_transport( &self, bundle: &DeviceJoinOfferBundle, ) -> Result<DeviceJoinAbandonment, DeviceJoinTransportError>

Source

pub async fn abort_device_join_transport( &self, bundle: &DeviceJoinOfferBundle, ) -> Result<(), DeviceJoinTransportError>

Source

pub async fn begin_device_join( &self, member_pubkey: &str, ) -> Result<DeviceJoinOffer, DeviceJoinError>

Source

pub async fn abandon_device_join( &self, offer: DeviceJoinOffer, ) -> Result<DeviceJoinAbandonment, DeviceJoinError>

Source

pub async fn authorize_device_provider_access( &self, request: DeviceProviderAccessRequest, access_administrator: Option<&dyn DeviceProviderAccessAdministrator>, ) -> Result<DeviceProviderAdmissionApproval, DeviceJoinError>

Source

pub async fn accept_device_registration( &self, request: DeviceRegistrationRequest, ) -> Result<ProvisionalDeviceBootstrap, DeviceJoinError>

Source

pub async fn publish_device_provider_challenge( &self, bootstrap: ProvisionalDeviceBootstrap, ) -> Result<ProviderReadyDeviceBootstrap, DeviceJoinError>

Source

pub async fn complete_device_provider_admission( &self, readiness: DeviceJoinReadiness, ) -> Result<DeviceProviderAdmissionCompletion, DeviceJoinError>

Source

pub async fn finalize_device_join( &self, completion: DeviceProviderAdmissionCompletion, ) -> Result<DeviceJoinActivation, DeviceJoinError>

Source

pub fn config(&self) -> &Config

Source

pub fn blob_path_scheme(&self) -> BlobPathScheme

Source

pub fn is_encrypted(&self) -> bool

Source

pub async fn admit_member( &self, public_key_hex: &str, member_email: Option<&str>, role: MemberRole, store_name: &str, ) -> Result<MemberAdmission, MembershipOpsError>

Source

pub async fn remove_member( &self, public_key_hex: &str, ) -> Result<String, MembershipOpsError>

Source

pub async fn resolve_membership_conflict( &self, choice: &MembershipConflictChoice, ) -> Result<(), MembershipOpsError>

Source

pub async fn drain_uploads(&self) -> Result<DrainOutcome, StoreError>

Source

pub async fn make_remote( &self, root_table: &str, root_id: &str, root_label: &str, pin: bool, refs: Vec<RowBlobRef>, ) -> Result<(), MakeRemoteError>

Source

pub async fn make_remote_batch( &self, root_table: &str, roots: Vec<MakeRemoteRoot>, pin: bool, ) -> Result<(), MakeRemoteError>

Source

pub async fn cancel_make_remote( &self, root_table: &str, root_id: &str, ) -> Result<(), MakeRemoteError>

Source

pub async fn make_local( &self, root_table: &str, root_id: &str, dest: &HashMap<String, PathBuf>, cancel: &Receiver<bool>, ) -> Result<(), MakeLocalError>

Source

pub async fn create_circle( &self, name: &str, ) -> Result<CircleId, CircleOperationError>

Source

pub async fn rename_circle( &self, circle_id: CircleId, name: &str, ) -> Result<(), CircleOperationError>

Source

pub async fn add_circle_member( &self, circle_id: CircleId, member_pubkey: String, role: CircleRole, ) -> Result<(), CircleOperationError>

Source

pub async fn remove_circle_member( &self, circle_id: CircleId, member_pubkey: String, ) -> Result<CircleOperationId, CircleOperationError>

Source

pub async fn resolve_circle_control( &self, circle_id: CircleId, chosen: CircleControlCoord, ) -> Result<(), CircleOperationError>

Source

pub async fn cancel_circle_epoch_close( &self, circle_id: CircleId, ) -> Result<CircleOperationId, CircleOperationError>

Source

pub async fn exclude_circle_close_device( &self, circle_id: CircleId, excluded_device_id: StoreDeviceId, ) -> Result<(), CircleOperationError>

Source

pub async fn delete_circle( &self, circle_id: CircleId, ) -> Result<(), CircleOperationError>

Source

pub async fn retry_circle_operation( &self, operation_id: CircleOperationId, ) -> Result<(), CircleOperationError>

Source

pub async fn discard_circle_operation( &self, operation_id: CircleOperationId, ) -> Result<(), CircleOperationError>

Source

pub async fn retry_stuck_reclaim( &self, operation_id: ObjectHash, ) -> Result<(), RetryStuckReclaimError>

Clear one reclaim operation’s stuck mark, so the journal runs it again.

Runs on the loop thread, so it never lands in the middle of a pass that has already read the journal; delivering it also ends the loop’s wait, so the cycle that re-runs the operation begins straight after.

Source

pub async fn circle_close_status( &self, circle_id: CircleId, ) -> Result<CircleCloseStatus, CircleOperationError>

Inspect a Circle’s in-flight epoch close. A read, so it runs directly on the components rather than serializing behind the write-command channel.

Source

pub fn uses_storage_for_test( &self, expected: &Arc<dyn CloudSyncObjectStorage>, ) -> bool

Source

pub fn uses_store_dir_for_test(&self, expected: &StoreDir) -> bool

Source

pub fn encryption_generation_for_test(&self) -> Option<u64>

Source

pub fn open_sealed_blob_for_test( &self, stored: &[u8], aad_context: &[u8], ) -> Result<(KeyFingerprint, Vec<u8>), EncryptionError>

Source

pub fn adopt_key_rotation_for_test( &self, encryption: EncryptionService, ) -> Result<String, KeyError>

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> 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: 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: 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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,

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

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