pub struct StorageConnection<P: ?Sized = dyn ProviderOps> { /* private fields */ }Expand description
Applies the storage contract around native provider calls (E5). Every consumer uses this capability and waits for the same provider cooldown.
Implementations§
Source§impl<P: ProviderOps + ?Sized> StorageConnection<P>
impl<P: ProviderOps + ?Sized> StorageConnection<P>
Sourcepub async fn labelled_config(&self) -> Result<StorageConfig, StorageError>
pub async fn labelled_config(&self) -> Result<StorageConfig, StorageError>
This connection’s location with its folder’s label as the provider answers it now: a Dropbox shared folder’s or a OneDrive folder’s. Other locations have none and send no request. A failed read keeps its provider cause.
Source§impl<P: ProviderOps + ?Sized> StorageConnection<P>
impl<P: ProviderOps + ?Sized> StorageConnection<P>
Sourcepub async fn claim_location(&self, store: StoreId) -> Result<(), StorageError>
pub async fn claim_location(&self, store: StoreId) -> Result<(), StorageError>
First setup claims the location after provider validation and before publishing store state. An occupied marker is accepted only when its exact bytes name this store. No failure removes or replaces the marker. A location that holds several stores has no marker.
Sourcepub async fn check_location_claim(
&self,
store: StoreId,
) -> Result<(), StorageError>
pub async fn check_location_claim( &self, store: StoreId, ) -> Result<(), StorageError>
Reconnect, restore and join read the exact location marker without listing the root or claiming an absent marker. Provider errors survive; missing, malformed and other-store markers refuse this connection.
Source§impl StorageConnection<MemoryProvider>
impl StorageConnection<MemoryProvider>
Sourcepub async fn started_upload(
&self,
path: &ObjectPath,
) -> Result<UploadSession, StorageError>
pub async fn started_upload( &self, path: &ObjectPath, ) -> Result<UploadSession, StorageError>
A four-byte upload to path the provider holds unpublished: begun,
then started by its first and only part, as an S3 multipart upload
is (Appendix E.10).
Sourcepub async fn holds(&self, session: &UploadSession) -> bool
pub async fn holds(&self, session: &UploadSession) -> bool
Whether the provider holds the unfinished session session names; a
plan names none until its first part starts it.
Sourcepub async fn unfinished_uploads(&self) -> Vec<(DeviceId, ObjectPath)>
pub async fn unfinished_uploads(&self) -> Vec<(DeviceId, ObjectPath)>
Each session still unfinished, in the order it began: the device whose connection began it, and its destination.
Source§impl StorageConnection<MemoryProvider>
impl StorageConnection<MemoryProvider>
Sourcepub async fn hold_next_read(
&self,
path: ObjectPath,
observed: Sender<()>,
resume: Receiver<()>,
)
pub async fn hold_next_read( &self, path: ObjectPath, observed: Sender<()>, resume: Receiver<()>, )
Hold an exact read after fixing its response, including a missing object.
Sourcepub async fn hold_body_at(
&self,
path: ObjectPath,
at: u64,
observed: Sender<()>,
resume: Receiver<()>,
)
pub async fn hold_body_at( &self, path: ObjectPath, at: u64, observed: Sender<()>, resume: Receiver<()>, )
Stall the next response body for path that reaches object offset at,
after delivering every byte before it, until resume is released.
Sourcepub async fn received_buffers(&self) -> Vec<usize>
pub async fn received_buffers(&self) -> Vec<usize>
Buffers delivered by response bodies, without counting metadata as bytes.
Source§impl StorageConnection<MemoryProvider>
impl StorageConnection<MemoryProvider>
Sourcepub fn request_trace(&self) -> Vec<MemoryRequest>
pub fn request_trace(&self) -> Vec<MemoryRequest>
Attempted calls on this connection; for_device starts a separate trace.
Source§impl StorageConnection<MemoryProvider>
impl StorageConnection<MemoryProvider>
Sourcepub async fn hold_next_listing(
&self,
prefix: ObjectPrefix,
listed: Sender<()>,
resume: Receiver<()>,
)
pub async fn hold_next_listing( &self, prefix: ObjectPrefix, listed: Sender<()>, resume: Receiver<()>, )
Hold one listing’s reply after taking its snapshot. The test is notified when the result is fixed, and can mutate remote state before releasing it.
Sourcepub async fn hold_next_request(&self, started: Sender<()>, resume: Receiver<()>)
pub async fn hold_next_request(&self, started: Sender<()>, resume: Receiver<()>)
Hold the next request, whatever it is, once it is recorded: tell
started, then wait for resume.
Sourcepub async fn hold_next_request_of(
&self,
request: MemoryRequest,
started: Sender<()>,
resume: Receiver<()>,
)
pub async fn hold_next_request_of( &self, request: MemoryRequest, started: Sender<()>, resume: Receiver<()>, )
Hold the next request that is request once it is recorded, as
Self::hold_next_request does; every other request goes through.
Sourcepub async fn hold_next_creation(
&self,
prefix: ObjectPrefix,
started: Sender<()>,
resume: Receiver<()>,
)
pub async fn hold_next_creation( &self, prefix: ObjectPrefix, started: Sender<()>, resume: Receiver<()>, )
Hold a single-request creation before publication, notifying its observer.
Source§impl StorageConnection<MemoryProvider>
impl StorageConnection<MemoryProvider>
Sourcepub async fn rename_folder(&self, name: &str)
pub async fn rename_folder(&self, name: &str)
Rename the store’s folder as its owner would in Dropbox or OneDrive,
without a request: the next folder label read answers name.
Sourcepub async fn plant_location_marker(&self, bytes: Option<Vec<u8>>)
pub async fn plant_location_marker(&self, bytes: Option<Vec<u8>>)
Replace or remove the location marker as an external actor, without a request.
Sourcepub fn with_publication_gate(
&self,
publications: Arc<dyn PublicationGate>,
) -> Self
pub fn with_publication_gate( &self, publications: Arc<dyn PublicationGate>, ) -> Self
Bind a simulated installation to the real synchronization gate, preserving this provider’s credentials, durable objects and request observations.
Sourcepub fn with_device(&self, device: DeviceId) -> Self
pub fn with_device(&self, device: DeviceId) -> Self
Write for device on this simulated connection: what it stages sits
in that device’s reserved folder (D10).
Sourcepub fn with_cooldown(&self, cooldown: Arc<dyn Cooldown>) -> Self
pub fn with_cooldown(&self, cooldown: Arc<dyn Cooldown>) -> Self
Bind this connection to the store’s shared provider cooldown.
Sourcepub fn with_transfers(&self, transfers: Arc<TransferBudget>) -> Self
pub fn with_transfers(&self, transfers: Arc<TransferBudget>) -> Self
Use the handle’s transfer budget on this simulated connection.
Erase the provider type while retaining this exact connection’s credentials.
Source§impl StorageConnection<MemoryProvider>
impl StorageConnection<MemoryProvider>
Sourcepub fn builder() -> MemoryStorageBuilder
pub fn builder() -> MemoryStorageBuilder
An S3 test location at the Unix epoch, with four-MiB single requests and 64-KiB parts. Override only the choices relevant to the scenario.
Sourcepub fn for_recipient(owner: &Self, email: &str) -> Result<Self, StorageError>
pub fn for_recipient(owner: &Self, email: &str) -> Result<Self, StorageError>
A separate non-owner account using the same provider location. Its sign-in is independent; access requires a grant and, where needed, recipient joining. S3 keys are administered outside the fake’s account-sharing model.
Sourcepub fn for_device(&self) -> Self
pub fn for_device(&self) -> Self
Another device connected to the same durable backend, with independent credentials, request notifications and network availability.
Sourcepub async fn connect_device(
&self,
config: StorageConfig,
auth: ProviderAuth,
) -> Result<Self, StorageError>
pub async fn connect_device( &self, config: StorageConfig, auth: ProviderAuth, ) -> Result<Self, StorageError>
Construct a candidate device connection whose credentials can be inspected independently from the source’s credentials and durable provider objects.
Sourcepub fn set_online(&self, online: bool)
pub fn set_online(&self, online: bool)
Set this connection’s network availability without changing other devices.
Sourcepub fn subscribe_requests(&self) -> RequestWatch
pub fn subscribe_requests(&self) -> RequestWatch
Request notifications include failed attempts, so tests can wait without polling.
Sourcepub fn peak_requests(&self) -> usize
pub fn peak_requests(&self) -> usize
Greatest number of requests overlapping an injected delay or barrier.
Sourcepub fn reset_request_peak(&self)
pub fn reset_request_peak(&self)
Reset the peak for subsequent request starts, retaining active requests.
Sourcepub fn request_count(&self) -> u64
pub fn request_count(&self) -> u64
Every attempted provider request, including injected failures.
Sourcepub async fn s3_credentials(&self) -> Option<S3Credentials>
pub async fn s3_credentials(&self) -> Option<S3Credentials>
The key currently installed on this simulated provider connection.
Sourcepub async fn s3_access_key_id(&self) -> Option<String>
pub async fn s3_access_key_id(&self) -> Option<String>
The most recently installed S3 access-key id, without exposing its secret.
Sourcepub async fn reads(&self) -> Vec<(ObjectPath, u64, u64)>
pub async fn reads(&self) -> Vec<(ObjectPath, u64, u64)>
Opened responses as (path, offset, declared byte count), including whole objects.
Sourcepub async fn moved_bytes(&self, path: &ObjectPath) -> u64
pub async fn moved_bytes(&self, path: &ObjectPath) -> u64
The bytes the reads of path moved as their bodies delivered them:
each byte, or, on a provider whose reads move whole parts, each part
whole once a body delivered a byte of it.
Sourcepub async fn transferred(&self) -> (u64, usize)
pub async fn transferred(&self) -> (u64, usize)
Part bytes with successful replies and their largest buffer, across sessions.
Sourcepub async fn corrupt_byte(
&self,
path: &ObjectPath,
offset: usize,
) -> Result<(), StorageError>
pub async fn corrupt_byte( &self, path: &ObjectPath, offset: usize, ) -> Result<(), StorageError>
Damage one stored byte without issuing a provider request.
Sourcepub async fn plant(
&self,
path: &ObjectPath,
bytes: &[u8],
) -> Result<(), StorageError>
pub async fn plant( &self, path: &ObjectPath, bytes: &[u8], ) -> Result<(), StorageError>
Store an object without a request or this connection’s size limits, as anyone holding the storage’s credentials could (§3).
Sourcepub async fn wait_for_object(
&self,
wanted: impl Fn(&ObjectPath) -> bool,
) -> ObjectPath
pub async fn wait_for_object( &self, wanted: impl Fn(&ObjectPath) -> bool, ) -> ObjectPath
Resolves once the provider holds an object at a path wanted
accepts, with that path; no request is made. A request is in the
trace as it goes out, before its object is stored, so the trace
can’t tell this.
Sourcepub async fn reject_access_token(&self, token: &str)
pub async fn reject_access_token(&self, token: &str)
Refuse this access token from now on, on every connection, as a provider 401 would (§20.2).
Sourcepub async fn set_faults(&self, faults: Faults)
pub async fn set_faults(&self, faults: Faults)
Set faults absolutely, so repeating the command has the same effect.
Sourcepub async fn hold_creations(&self, barrier: Arc<Barrier>)
pub async fn hold_creations(&self, barrier: Arc<Barrier>)
Hold each create, including injected failures, until all writers
arrive at the test’s barrier.
Sourcepub async fn gate_creations(&self, gate: Arc<Semaphore>)
pub async fn gate_creations(&self, gate: Arc<Semaphore>)
Hold each create until the test adds a permit to gate; each create
takes one, oldest first, so a test releases held creates one at a time.
Sourcepub async fn gate_parts(&self, gate: Arc<Semaphore>)
pub async fn gate_parts(&self, gate: Arc<Semaphore>)
Hold each part, its bytes taken, until the test adds a permit to
gate; each part takes one, oldest first.
Sourcepub async fn gate_reads(&self, gate: Arc<Semaphore>)
pub async fn gate_reads(&self, gate: Arc<Semaphore>)
Hold each read until the test adds a permit to gate; each read takes
one, oldest first.
Whether the store is shared with account: granted and not since
revoked.
Sourcepub async fn joined(&self, account: &str) -> bool
pub async fn joined(&self, account: &str) -> bool
Whether account has accepted the store’s share, as a Dropbox mount
does, and not since left it or lost it.
Sourcepub async fn set_retained_access(
&self,
account: &str,
shares: Vec<RetainedAccess>,
)
pub async fn set_retained_access( &self, account: &str, shares: Vec<RetainedAccess>, )
Model native grants that remain until the owner changes them in the provider.
Source§impl<P: ProviderOps + ?Sized> StorageConnection<P>
impl<P: ProviderOps + ?Sized> StorageConnection<P>
Sourcepub fn during_setup(&self, waits: SetupWaits) -> Self
pub fn during_setup(&self, waits: SetupWaits) -> Self
A connection beside this one for the setup call spending waits,
and only for that call’s own requests: one client to the provider
with this one, through the same provider, cooldown, publications and
transfer limits, but its reads, listings, deletions, creates and
replacements refused for rate limiting are sent again until the
call’s minute is spent. Upload session steps and sharing requests are
not: a session’s owner settles its steps through the recorded session
(§20.6). The call drops it, and its waits, when it ends.
Sourcepub fn requests(&self) -> RequestCounts
pub fn requests(&self) -> RequestCounts
Every request this connection has sent so far, by kind.
Sourcepub async fn end_detection_run(
&self,
store: StoreId,
run: Uuid,
) -> Result<(), StorageError>
pub async fn end_detection_run( &self, store: StoreId, run: Uuid, ) -> Result<(), StorageError>
Abort the unfinished multipart uploads S3 detection run run left
in store’s .coven-check prefix, then delete its probes (§20.7),
as listing the run’s prefix finds them. One already gone succeeds.
Trait Implementations§
Source§impl<P: ProviderOps + ?Sized> Storage for StorageConnection<P>
impl<P: ProviderOps + ?Sized> Storage for StorageConnection<P>
Source§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 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,
During setup a resend refused as an occupied path may have met its own earlier attempt: a copy publication can store the object, then have its temporary’s deletion refused (§20.6). The object holding exactly these sealed bytes settles it as created.
Source§fn config(&self) -> StorageConfig
fn config(&self) -> StorageConfig
Source§fn single_request_limit(&self) -> u64
fn single_request_limit(&self) -> u64
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.Source§fn read_part_size(&self) -> Option<NonZeroU64>
fn read_part_size(&self) -> Option<NonZeroU64>
None when a range
moves only its own bytes.Source§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 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,
Source§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 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,
Source§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 account<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§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 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,
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.Source§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 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,
Source§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 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).Source§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 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,
Source§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 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,
Source§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_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,
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.Source§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_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,
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.Source§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,
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,
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).Source§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 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,
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. Read moreSource§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 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,
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. Read moreSource§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 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,
crate::StorageInvitation,
not a revocation grant id. Removal during joining returns the provider’s
permission failure; an admin can invite again.Source§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 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,
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.Source§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_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,
Source§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 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,
Source§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 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,
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.Source§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 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,
finish_upload.Source§fn 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>
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).Source§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_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,
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.Source§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 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,
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.Source§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 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,
SessionExpired requires a fresh
session with the same bytes; a Cleanup error must not bypass failed abort.Source§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 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,
Source§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 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,
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).Source§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 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,
Source§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_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,
stream_object directly. This convenience
reader holds at most 32 MiB, regardless of provider metadata.Source§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<'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_object.Source§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 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,
Source§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 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.Source§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,
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,
Auto Trait Implementations§
impl<P = dyn ProviderOps> !Freeze for StorageConnection<P>
impl<P = dyn ProviderOps> !RefUnwindSafe for StorageConnection<P>
impl<P> Send for StorageConnection<P>
impl<P> Sync for StorageConnection<P>
impl<P> Unpin for StorageConnection<P>where
P: ?Sized,
impl<P> UnsafeUnpin for StorageConnection<P>where
P: ?Sized,
impl<P = dyn ProviderOps> !UnwindSafe for StorageConnection<P>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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