pub struct SyncLoopHandle { /* private fields */ }Expand description
Manages the background sync loop and provides access to sync components.
Implementations§
Source§impl SyncLoopHandle
impl SyncLoopHandle
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
Sourcepub fn provider_requests(&self) -> Option<Arc<dyn ProviderRequests>>
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.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Whether the background sync thread is running.
Sourcepub fn trigger(&self)
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.
Sourcepub fn cancel_eager_cache_fill(&self)
pub fn cancel_eager_cache_fill(&self)
Stop the post-open CacheEager fill without stopping cloud sync.
pub async fn discard_blocked_write( &self, write_id: WriteId, ) -> Result<Vec<WriteId>, StoreError>
pub async fn members(&self) -> Result<Vec<MemberInfo>, MembershipOpsError>
pub async fn membership_conflict( &self, ) -> Result<Option<MembershipConflictInfo>, MembershipOpsError>
pub async fn restore_membership( &self, ) -> Result<StoreRestoreMembership, MembershipOpsError>
pub fn host_write_blob_staging(&self, runtime: Handle) -> HostWriteBlobStaging
pub async fn propose_device_exclusion( &self, device_id: StoreDeviceId, ) -> Result<StoreDeviceExclusionProposalRef, StoreDeviceExclusionError>
pub async fn cancel_device_exclusion( &self, proposal: &StoreDeviceExclusionProposalRef, ) -> Result<(), StoreDeviceExclusionError>
pub async fn finalize_device_exclusion( &self, proposal: &StoreDeviceExclusionProposalRef, ) -> Result<(), StoreDeviceExclusionError>
pub async fn begin_owner_promotion( &self, device_id: StoreDeviceId, ) -> Result<OwnerPromotionRequest, OwnerPromotionError>
pub async fn accept_owner_promotion( &self, request: OwnerPromotionRequest, ) -> Result<OwnerPromotionAcceptance, OwnerPromotionError>
pub async fn finalize_owner_promotion( &self, acceptance: OwnerPromotionAcceptance, ) -> Result<(), OwnerPromotionError>
pub async fn begin_device_join_bundle( &self, member_pubkey: &str, ) -> Result<DeviceJoinOfferBundle, DeviceJoinTransportError>
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>
pub async fn abandon_device_join_transport( &self, bundle: &DeviceJoinOfferBundle, ) -> Result<DeviceJoinAbandonment, DeviceJoinTransportError>
pub async fn abort_device_join_transport( &self, bundle: &DeviceJoinOfferBundle, ) -> Result<(), DeviceJoinTransportError>
pub async fn begin_device_join( &self, member_pubkey: &str, ) -> Result<DeviceJoinOffer, DeviceJoinError>
pub async fn abandon_device_join( &self, offer: DeviceJoinOffer, ) -> Result<DeviceJoinAbandonment, DeviceJoinError>
pub async fn accept_device_registration( &self, request: DeviceRegistrationRequest, ) -> Result<ProvisionalDeviceBootstrap, DeviceJoinError>
pub async fn publish_device_provider_challenge( &self, bootstrap: ProvisionalDeviceBootstrap, ) -> Result<ProviderReadyDeviceBootstrap, DeviceJoinError>
pub async fn complete_device_provider_admission( &self, readiness: DeviceJoinReadiness, ) -> Result<DeviceProviderAdmissionCompletion, DeviceJoinError>
pub async fn finalize_device_join( &self, completion: DeviceProviderAdmissionCompletion, ) -> Result<DeviceJoinActivation, DeviceJoinError>
pub fn config(&self) -> &Config
pub fn blob_path_scheme(&self) -> BlobPathScheme
pub fn is_encrypted(&self) -> bool
pub async fn admit_member( &self, public_key_hex: &str, member_email: Option<&str>, role: MemberRole, store_name: &str, ) -> Result<MemberAdmission, MembershipOpsError>
pub async fn remove_member( &self, public_key_hex: &str, ) -> Result<String, MembershipOpsError>
pub async fn resolve_membership_conflict( &self, choice: &MembershipConflictChoice, ) -> Result<(), MembershipOpsError>
pub async fn drain_uploads(&self) -> Result<DrainOutcome, StoreError>
pub async fn make_remote( &self, root_table: &str, root_id: &str, root_label: &str, pin: bool, refs: Vec<RowBlobRef>, ) -> Result<(), MakeRemoteError>
pub async fn make_remote_batch( &self, root_table: &str, roots: Vec<MakeRemoteRoot>, pin: bool, ) -> Result<(), MakeRemoteError>
pub async fn cancel_make_remote( &self, root_table: &str, root_id: &str, ) -> Result<(), MakeRemoteError>
pub async fn make_local( &self, root_table: &str, root_id: &str, dest: &HashMap<String, PathBuf>, cancel: &Receiver<bool>, ) -> Result<(), MakeLocalError>
pub async fn create_circle( &self, name: &str, ) -> Result<CircleId, CircleOperationError>
pub async fn rename_circle( &self, circle_id: CircleId, name: &str, ) -> Result<(), CircleOperationError>
pub async fn add_circle_member( &self, circle_id: CircleId, member_pubkey: String, role: CircleRole, ) -> Result<(), CircleOperationError>
pub async fn remove_circle_member( &self, circle_id: CircleId, member_pubkey: String, ) -> Result<CircleOperationId, CircleOperationError>
pub async fn resolve_circle_control( &self, circle_id: CircleId, chosen: CircleControlCoord, ) -> Result<(), CircleOperationError>
pub async fn cancel_circle_epoch_close( &self, circle_id: CircleId, ) -> Result<CircleOperationId, CircleOperationError>
pub async fn exclude_circle_close_device( &self, circle_id: CircleId, excluded_device_id: StoreDeviceId, ) -> Result<(), CircleOperationError>
pub async fn delete_circle( &self, circle_id: CircleId, ) -> Result<(), CircleOperationError>
pub async fn retry_circle_operation( &self, operation_id: CircleOperationId, ) -> Result<(), CircleOperationError>
pub async fn discard_circle_operation( &self, operation_id: CircleOperationId, ) -> Result<(), CircleOperationError>
Sourcepub async fn retry_stuck_reclaim(
&self,
operation_id: ObjectHash,
) -> Result<(), RetryStuckReclaimError>
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.
Sourcepub async fn circle_close_status(
&self,
circle_id: CircleId,
) -> Result<CircleCloseStatus, CircleOperationError>
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.
pub fn uses_storage_for_test( &self, expected: &Arc<dyn CloudSyncObjectStorage>, ) -> bool
pub fn uses_store_dir_for_test(&self, expected: &StoreDir) -> bool
pub fn encryption_generation_for_test(&self) -> Option<u64>
pub fn open_sealed_blob_for_test( &self, stored: &[u8], aad_context: &[u8], ) -> Result<(KeyFingerprint, Vec<u8>), EncryptionError>
pub fn adopt_key_rotation_for_test( &self, encryption: EncryptionService, ) -> Result<String, KeyError>
Auto Trait Implementations§
impl !Freeze for SyncLoopHandle
impl !RefUnwindSafe for SyncLoopHandle
impl Send for SyncLoopHandle
impl Sync for SyncLoopHandle
impl Unpin for SyncLoopHandle
impl UnsafeUnpin for SyncLoopHandle
impl !UnwindSafe for SyncLoopHandle
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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