pub struct ProviderConnector { /* private fields */ }Expand description
The provider composition root retains the supplied clock and id source, and the one HTTP client every connection it makes sends through.
Implementations§
Source§impl ProviderConnector
impl ProviderConnector
Sourcepub fn new(clock: ClockRef, ids: IdSourceRef) -> Self
pub fn new(clock: ClockRef, ids: IdSourceRef) -> Self
Retain the capabilities used to construct subsequent connections.
Sourcepub fn with_folder_api(self, api: String) -> Self
pub fn with_folder_api(self, api: String) -> Self
Send account and folder calls to an in-process provider API in application tests.
Sourcepub async fn empty_s3_bucket(
&self,
config: StorageConfig,
credentials: S3Credentials,
) -> Result<EmptiedS3Bucket, EmptyS3BucketError>
pub async fn empty_s3_bucket( &self, config: StorageConfig, credentials: S3Credentials, ) -> Result<EmptiedS3Bucket, EmptyS3BucketError>
Delete every object and abort every unfinished upload in an S3 location’s bucket, once its root shows it holds only stores, with this connector’s clock, ids and HTTP client (api.md E14). A development tool outside the sync protocol.
Trait Implementations§
Source§impl StorageConnector for ProviderConnector
impl StorageConnector for ProviderConnector
Source§fn onedrive_root<'life0, 'async_trait>(
&'life0 self,
auth: ProviderAuth,
cooldown: Arc<dyn Cooldown>,
) -> Pin<Box<dyn Future<Output = Result<StorageFolder, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn onedrive_root<'life0, 'async_trait>(
&'life0 self,
auth: ProviderAuth,
cooldown: Arc<dyn Cooldown>,
) -> Pin<Box<dyn Future<Output = Result<StorageFolder, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read the signed-in OneDrive root.
Source§fn onedrive_folders<'life0, 'life1, 'async_trait>(
&'life0 self,
parent: &'life1 StorageConfig,
auth: ProviderAuth,
cooldown: Arc<dyn Cooldown>,
) -> Pin<Box<dyn Future<Output = Result<Vec<StorageFolder>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn onedrive_folders<'life0, 'life1, 'async_trait>(
&'life0 self,
parent: &'life1 StorageConfig,
auth: ProviderAuth,
cooldown: Arc<dyn Cooldown>,
) -> Pin<Box<dyn Future<Output = Result<Vec<StorageFolder>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read all immediate OneDrive child folders.
Source§fn create_onedrive_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
parent: &'life1 StorageConfig,
name: &'life2 str,
auth: ProviderAuth,
cooldown: Arc<dyn Cooldown>,
) -> Pin<Box<dyn Future<Output = Result<StorageFolder, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_onedrive_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
parent: &'life1 StorageConfig,
name: &'life2 str,
auth: ProviderAuth,
cooldown: Arc<dyn Cooldown>,
) -> Pin<Box<dyn Future<Output = Result<StorageFolder, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a OneDrive folder without renaming or replacing an occupied name.
Read all shared Dropbox namespaces.
Make a folder named name at the top of the signed-in Dropbox and
share it, refusing a name already taken.
Source§fn account_label<'life0, 'async_trait>(
&'life0 self,
auth: ProviderAuth,
cooldown: Arc<dyn Cooldown>,
) -> Pin<Box<dyn Future<Output = Result<String, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn account_label<'life0, 'async_trait>(
&'life0 self,
auth: ProviderAuth,
cooldown: Arc<dyn Cooldown>,
) -> Pin<Box<dyn Future<Output = Result<String, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn prepare_cloudkit<'life0, 'life1, 'async_trait>(
&'life0 self,
container: &'life1 str,
store: StoreId,
) -> Pin<Box<dyn Future<Output = Result<StorageConfig, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn prepare_cloudkit<'life0, 'life1, 'async_trait>(
&'life0 self,
container: &'life1 str,
store: StoreId,
) -> Pin<Box<dyn Future<Output = Result<StorageConfig, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
config: StorageConfig,
auth: ProviderAuth,
device: DeviceId,
publications: Arc<dyn PublicationGate>,
cooldown: Arc<dyn Cooldown>,
transfers: Arc<TransferBudget>,
) -> Pin<Box<dyn Future<Output = Result<Arc<StorageConnection>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
config: StorageConfig,
auth: ProviderAuth,
device: DeviceId,
publications: Arc<dyn PublicationGate>,
cooldown: Arc<dyn Cooldown>,
transfers: Arc<TransferBudget>,
) -> Pin<Box<dyn Future<Output = Result<Arc<StorageConnection>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
cooldown; a rejected OAuth token is refreshed in
the sign-in’s custody (§20.2). A setup call makes its own
connection beside it (StorageConnection::during_setup) for its
requests to draw on its waits (§20.8).
The connection writes for device: what it stages sits in that
device’s reserved folder (D10).Source§fn detect_s3<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: StorageConfig,
credentials: S3Credentials,
store: StoreId,
runs: &'life1 S3DetectionRuns,
waits: &'life2 SetupWaits,
) -> Pin<Box<dyn Future<Output = S3DetectionRun> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn detect_s3<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: StorageConfig,
credentials: S3Credentials,
store: StoreId,
runs: &'life1 S3DetectionRuns,
waits: &'life2 SetupWaits,
) -> Pin<Box<dyn Future<Output = S3DetectionRun> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
.coven-check/<run>/ prefix for runs.run and deleting
them, also on failure, then removing what each of runs.earlier
left there. The caller recorded runs.run before calling; the answer
names the runs whose probes and uploads are confirmed gone.
A connector without native S3 refuses this capability.
A rate-limited probe is sent again while setup’s waits allow (§20.8).Source§fn check_new_store<'life0, 'life1, 'async_trait>(
&'life0 self,
config: StorageConfig,
auth: ProviderAuth,
store: StoreId,
waits: &'life1 SetupWaits,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_new_store<'life0, 'life1, 'async_trait>(
&'life0 self,
config: StorageConfig,
auth: ProviderAuth,
store: StoreId,
waits: &'life1 SetupWaits,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
coven-location marker (§20.3).
Reads only. A connector without that provider refuses this capability.
A rate-limited listing is sent again while setup’s waits allow.Auto Trait Implementations§
impl Freeze for ProviderConnector
impl !RefUnwindSafe for ProviderConnector
impl Send for ProviderConnector
impl Sync for ProviderConnector
impl Unpin for ProviderConnector
impl UnsafeUnpin for ProviderConnector
impl !UnwindSafe for ProviderConnector
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