pub trait Storage: Send + Sync {
Show 35 methods
// Required methods
fn config(&self) -> StorageConfig;
fn single_request_limit(&self) -> u64;
fn create_reporting<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
bytes: &'life2 [u8],
sent: &'life3 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredObject>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn replace<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
previous: &'life1 StoredObject,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn status<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredObject>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn stream_object_reporting<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: Option<ByteRange>,
received: &'life2 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<ObjectStream<'_>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 ObjectPrefix,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoredObject>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn grant_access<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AccessGrant, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn revoke_access<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<RetainedAccess>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn begin_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
total: u64,
) -> Pin<Box<dyn Future<Output = Result<UploadSession, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn begin_replace<'life0, 'life1, 'async_trait>(
&'life0 self,
previous: &'life1 StoredObject,
total: u64,
) -> Pin<Box<dyn Future<Output = Result<UploadSession, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn resume_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 mut UploadSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn admit_part<'a>(
&self,
session: &mut UploadSession,
bytes: &'a [u8],
) -> Result<PartPermit<'a>, StorageError>;
fn send_part<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
permit: PartPermit<'life1>,
session: &'life2 mut UploadSession,
sent: &'life3 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn send_independent_part<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 UploadSession,
offset: u64,
bytes: &'life2 [u8],
sent: &'life3 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<ConfirmedPart, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn finish_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 mut UploadSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn abort_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 UploadSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn end_superseded_floor_sessions<'life0, 'async_trait>(
&'life0 self,
store: StoreId,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn end_settled_claims<'life0, 'async_trait>(
&'life0 self,
store: StoreId,
through: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn end_device_uploads<'life0, 'async_trait>(
&'life0 self,
store: StoreId,
device: DeviceId,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn set_s3_credentials<'life0, 'async_trait>(
&'life0 self,
_credentials: S3Credentials,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn account<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn read_part_size(&self) -> Option<NonZeroU64> { ... }
fn set_oauth_tokens<'life0, 'async_trait>(
&'life0 self,
_tokens: OAuthTokens,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<StoredObject>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn stream_object<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: Option<ByteRange>,
) -> Pin<Box<dyn Future<Output = Result<ObjectStream<'_>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn read_object<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: Option<ByteRange>,
) -> Pin<Box<dyn Future<Output = Result<ObjectRead, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn read_range<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: ByteRange,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn delete_if_present<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn join<'life0, 'life1, 'async_trait>(
&'life0 self,
store: StoreId,
invitation: &'life1 StorageInvitation,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn leave<'life0, 'life1, 'async_trait>(
&'life0 self,
invitation: &'life1 StorageInvitation,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn restart_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
expired: &'life1 UploadSession,
) -> Pin<Box<dyn Future<Output = Result<UploadSession, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn upload_part<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session: &'life1 mut UploadSession,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
The operations coven needs from a provider (§20.1).
Implementations are capabilities assembled at composition roots. They own no database or key custody. Every mutation is awaited and failures reach the caller; no hidden background work repairs failed operations.
Required Methods§
Sourcefn config(&self) -> StorageConfig
fn config(&self) -> StorageConfig
This provider’s nonsecret location settings.
Sourcefn single_request_limit(&self) -> u64
fn single_request_limit(&self) -> u64
Largest complete encrypted body the provider takes in one request, in
bytes. Objects past it, or past crate::BUFFERED_REQUEST_LIMIT, go
in parts through resumable or multipart uploads
(crate::goes_in_parts). Buffered floor replacements accept
complete bodies up to this limit; OneDrive stages
the body in a revision-bound session before conditional publication.
Callers retaining sessions across crashes record begin_upload or
begin_replace sessions.
S3 uses 5 GiB, Dropbox 150 MiB and OneDrive 250,000,000 bytes.
CloudKit uses bounded 8 MiB assets.
Sourcefn create_reporting<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
bytes: &'life2 [u8],
sent: &'life3 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredObject>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_reporting<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
bytes: &'life2 [u8],
sent: &'life3 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredObject>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self::create, telling sent how many of the object’s bytes the
connection has taken, as it takes them: Dropbox’s, OneDrive’s and
S3’s bodies say as they go, CloudKit’s client as the fraction of each
asset sent (§6.7).
Sourcefn replace<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
previous: &'life1 StoredObject,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn replace<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
previous: &'life1 StoredObject,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Replace the floor only if its observed native revision still matches.
A stale observation returns Conflict without changing the object.
The new bytes become visible together, or not at all. A body above
Self::single_request_limit returns StorageFailure::SingleRequestTooLarge.
Sourcefn status<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredObject>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn status<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredObject>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Exact lookup. None means confirmed absence; failed lookups remain errors. Pending multipart assets must not be reported as complete objects.
Sourcefn stream_object_reporting<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: Option<ByteRange>,
received: &'life2 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<ObjectStream<'_>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn stream_object_reporting<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: Option<ByteRange>,
received: &'life2 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<ObjectStream<'_>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self::stream_object, telling received how far through the
object the bytes received reach, as they arrive: as the stream reads
them, and for CloudKit, whose client fetches a record’s asset whole,
as the fetch goes (§6.7).
Sourcefn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 ObjectPrefix,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoredObject>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 ObjectPrefix,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoredObject>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List every object under the prefix, across all pages. Missing or malformed metadata fails the call.
Sourcefn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete an object. An already absent object succeeds, making operation retries safe. Sync chooses the deleting device under §16.6; storage exposes no deletion-rights query. A provider refusal retains its cause, including a refused owned-object deletion.
Sourcefn grant_access<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AccessGrant, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn grant_access<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AccessGrant, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Share the store using its owner’s account, or tell an S3 admin to create a key.
A signed-in sharing account that does not own the location gets NotStoreOwner.
Ownership comes from Dropbox’s folder access_type,
OneDrive’s current-account drive id, or CloudKit’s current user record id compared with the zone owner.
S3’s console-key instructions need no sharing-account check.
Inviting the account that holds the store gets
StorageFailure::InviteeIsStoreOwner. Dropbox and OneDrive refuse
before any sharing change; CloudKit learns it from the saved share,
which then lists only the owner.
Dropbox upgrades viewers in place with update_folder_member; a pending
viewer without a native account id gets StorageFailure::AccountIdUnavailable
and keeps its invitation.
Sourcefn revoke_access<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<RetainedAccess>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn revoke_access<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<RetainedAccess>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unshare through the owner’s account. Coven shares nothing on S3, so
there is nothing to take back.
Ownership is checked as for Self::grant_access. Only grants exclusive to
this account are removed; owner, inherited, shared or unidentified grants
are returned for owner action. An empty list confirms revocation.
OneDrive resolves native identities across all permission pages and keeps email-bearing grants until dependent ID-only removals succeed. Dropbox pages direct and inherited memberships separately and waits for the native removal job, preserving its failure cause; group and parent access remain reported.
Sourcefn begin_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
total: u64,
) -> Pin<Box<dyn Future<Output = Result<UploadSession, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn begin_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
total: u64,
) -> Pin<Box<dyn Future<Output = Result<UploadSession, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Begin a create-once upload, returning the value to record before parts are sent. This also creates an absent floor without exposing partial bytes.
Sourcefn begin_replace<'life0, 'life1, 'async_trait>(
&'life0 self,
previous: &'life1 StoredObject,
total: u64,
) -> Pin<Box<dyn Future<Output = Result<UploadSession, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn begin_replace<'life0, 'life1, 'async_trait>(
&'life0 self,
previous: &'life1 StoredObject,
total: u64,
) -> Pin<Box<dyn Future<Output = Result<UploadSession, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Begin a floor upload bound to this observed native revision. Record it before sending parts; restarting never adopts a newer revision.
Sourcefn resume_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 mut UploadSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resume_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 mut UploadSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Refresh a recorded session from the provider after interruption.
Persist the returned state even on failure, as with finish_upload.
Sourcefn admit_part<'a>(
&self,
session: &mut UploadSession,
bytes: &'a [u8],
) -> Result<PartPermit<'a>, StorageError>
fn admit_part<'a>( &self, session: &mut UploadSession, bytes: &'a [u8], ) -> Result<PartPermit<'a>, StorageError>
Admit bytes as the session’s next part, the first it has still to
send (UploadSession::parts_to_send), sending nothing. Refused
while a provider cooldown is live, for a session naming another
location, for a part that doesn’t fit the session, and while its
destination can’t be published (§17.9). Admitting a planned
session’s first part marks its plan, before any request that may
start its upload: when PartPermit::marked says so, save the
session before sending the part (Appendix E.10).
Sourcefn send_part<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
permit: PartPermit<'life1>,
session: &'life2 mut UploadSession,
sent: &'life3 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn send_part<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
permit: PartPermit<'life1>,
session: &'life2 mut UploadSession,
sent: &'life3 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Send an admitted part, advancing the value only after confirmation,
and telling sent how far through the object the part’s bytes the
connection has taken reach, as Self::create_reporting does. After
a lost publication reply this verifies the stored bytes instead; see
UploadSession.
Sourcefn send_independent_part<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 UploadSession,
offset: u64,
bytes: &'life2 [u8],
sent: &'life3 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<ConfirmedPart, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn send_independent_part<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 UploadSession,
offset: u64,
bytes: &'life2 [u8],
sent: &'life3 ByteProgress,
) -> Pin<Box<dyn Future<Output = Result<ConfirmedPart, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Send part offset.. of a session whose parts are independent
(UploadSession::parts_independent), leaving the session as it is:
the provider’s confirmation comes back, for the caller to add with
UploadSession::confirm and then record. Several parts may be in
flight at once and come back in any order (§17.9). Refused, sending
nothing, while a provider cooldown is live, for a session naming
another location or whose parts go in order, for a part that isn’t a
whole one the session lacks, and while its destination can’t be
published. sent hears the part’s bytes as Self::send_part’s do.
Sourcefn finish_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 mut UploadSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn finish_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 mut UploadSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Publish all stored parts at the destination. A repeated completion is safe.
Persist the session even on failure. SessionExpired requires a fresh
session with the same bytes; a Cleanup error must not bypass failed abort.
Sourcefn abort_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 UploadSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn abort_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 UploadSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Explicitly abandon an upload. Dropping a recorded value does not abort it. Already closed or absent sessions succeed; published objects are preserved.
Sourcefn end_superseded_floor_sessions<'life0, 'async_trait>(
&'life0 self,
store: StoreId,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn end_superseded_floor_sessions<'life0, 'async_trait>(
&'life0 self,
store: StoreId,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
End every unfinished session at store’s floor begun before the
current floor was published, whoever began it (§17.10): each observed
an older revision, so none can publish. Only where the provider dates
a session’s start, certified per S3 profile (Appendix E.6); elsewhere
it sends nothing.
Sourcefn end_settled_claims<'life0, 'async_trait>(
&'life0 self,
store: StoreId,
through: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn end_settled_claims<'life0, 'async_trait>(
&'life0 self,
store: StoreId,
through: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
End every unfinished session at slots 1 to through of store,
which this device has applied, whoever began it (§17.10): create-once
refuses each of them there, so none can ever publish, and a claimant
whose session is ended settles its claim as lost, as a refused one
does. Ending one already ended succeeds. Only S3 under conditional
completion puts a claim’s session at its slot’s path.
Sourcefn end_device_uploads<'life0, 'async_trait>(
&'life0 self,
store: StoreId,
device: DeviceId,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn end_device_uploads<'life0, 'async_trait>(
&'life0 self,
store: StoreId,
device: DeviceId,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
End every upload device left in store that this sign-in can see
(§17.10): abort its unfinished sessions and delete what it staged in
its reserved folder. One already ended succeeds, so devices may do it
at once. A Dropbox session, and a OneDrive native one, is seen by no
one else and expires on its own: on Dropbox this ends nothing, and on
OneDrive only staged temporaries (Appendix E.2).
Provided Methods§
Sourcefn set_s3_credentials<'life0, 'async_trait>(
&'life0 self,
_credentials: S3Credentials,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_s3_credentials<'life0, 'async_trait>(
&'life0 self,
_credentials: S3Credentials,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Install a member’s replacement S3 key after credential custody commits. Other provider kinds refuse this operation without changing sign-in state.
Sourcefn account<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn account<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The signed-in sharing account, for the member’s admin access entry. S3 uses its supplied access key id instead of an account lookup.
Sourcefn read_part_size(&self) -> Option<NonZeroU64>
fn read_part_size(&self) -> Option<NonZeroU64>
The size of the parts a ranged read moves whole, counted from the
object’s start, the last shorter: a range moves every part it
touches, as iCloud’s reads do (Appendix E.1). None when a range
moves only its own bytes.
Sourcefn set_oauth_tokens<'life0, 'async_trait>(
&'life0 self,
_tokens: OAuthTokens,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_oauth_tokens<'life0, 'async_trait>(
&'life0 self,
_tokens: OAuthTokens,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Install replacement OAuth tokens after the owner commits them to key custody. S3 and CloudKit refuse OAuth tokens; they use different account credentials.
Sourcefn create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<StoredObject>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<StoredObject>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a complete encrypted object, refusing an occupied path with
StorageFailure::AlreadyExists. Occupation alone proves nothing: a
retry compares the occupant’s complete bytes itself (§5.1, §19.3).
Bodies crate::goes_in_parts sends in parts use a session; a writes
slot can contain multiple writes in one object.
A failed transfer aborts the session;
if abort fails too, StorageError::Cleanup retains both causes.
Returns the object’s metadata when the provider’s one-request reply
carries it; otherwise exact status supplies it (§21.1).
Sourcefn stream_object<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: Option<ByteRange>,
) -> Pin<Box<dyn Future<Output = Result<ObjectStream<'_>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stream_object<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: Option<ByteRange>,
) -> Pin<Box<dyn Future<Output = Result<ObjectStream<'_>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read bytes and metadata from the same object revision. A range still reports the complete encrypted size and whole-object checksum semantics.
Sourcefn read_object<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: Option<ByteRange>,
) -> Pin<Box<dyn Future<Output = Result<ObjectRead, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_object<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: Option<ByteRange>,
) -> Pin<Box<dyn Future<Output = Result<ObjectRead, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Collect a bounded response through the streaming implementation. Large
writes and snapshots consume stream_object directly. This convenience
reader holds at most 32 MiB, regardless of provider metadata.
Sourcefn read<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read a bounded whole encrypted object; the limit is the same as read_object.
Sourcefn read_range<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: ByteRange,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_range<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
range: ByteRange,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch only the requested bytes; never silently shorten a range.
Sourcefn delete_if_present<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_if_present<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 ObjectPath,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self::delete for a caller that wants the object gone and has no use
for the difference between deleting it and finding nothing: a
NotFound failure, such as a provider reporting its folder missing,
is done too. Every other failure reaches the caller.
Sourcefn join<'life0, 'life1, 'async_trait>(
&'life0 self,
store: StoreId,
invitation: &'life1 StorageInvitation,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn join<'life0, 'life1, 'async_trait>(
&'life0 self,
store: StoreId,
invitation: &'life1 StorageInvitation,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Finish provider onboarding under the invited account, then check that the
location can be read. The facade verifies coven’s store identity and keys.
Dropbox mounts the shared namespace. OneDrive checks the share’s drive/folder
before redeeming it; CloudKit checks share metadata before native acceptance.
Native acceptance material comes from the encrypted crate::StorageInvitation,
not a revocation grant id. Removal during joining returns the provider’s
permission failure; an admin can invite again.
Sourcefn leave<'life0, 'life1, 'async_trait>(
&'life0 self,
invitation: &'life1 StorageInvitation,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn leave<'life0, 'life1, 'async_trait>(
&'life0 self,
invitation: &'life1 StorageInvitation,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Undo Self::join’s acceptance under the invited account, for a join
cancelled before its request was sent, keeping the invite usable
(§13.2, E.2). Dropbox unmounts the shared namespace, which leaves the
account a member, so joining again mounts it again; finding it
unmounted already, or the account no longer a member, is done. S3
accepts nothing. OneDrive and CloudKit undo nothing: Graph documents no
way for the recipient to give up a redeemed link’s access, and a
CloudKit participant that deletes the share is removed from it.
Sourcefn restart_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
expired: &'life1 UploadSession,
) -> Pin<Box<dyn Future<Output = Result<UploadSession, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn restart_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
expired: &'life1 UploadSession,
) -> Pin<Box<dyn Future<Output = Result<UploadSession, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Begin a fresh recorded session after resumption or publication reports
SessionExpired. A conflicted S3 session must be aborted first; failed
cleanup prevents a replacement from starting.
The destination and total stay fixed; the caller records the returned value
and supplies the retained encrypted bytes again, starting at offset zero.
Sourcefn upload_part<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session: &'life1 mut UploadSession,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn upload_part<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session: &'life1 mut UploadSession,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Admit and send the next part, for a caller that records the session only after the part: one that never resumes a planned session from a recording.