Skip to main content

StorageConnection

Struct StorageConnection 

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

Source

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>

Source

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.

Source

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>

Source

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).

Source

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.

Source

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>

Source

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.

Source

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.

Source

pub async fn received_buffers(&self) -> Vec<usize>

Buffers delivered by response bodies, without counting metadata as bytes.

Source§

impl StorageConnection<MemoryProvider>

Source

pub fn request_trace(&self) -> Vec<MemoryRequest>

Attempted calls on this connection; for_device starts a separate trace.

Source§

impl StorageConnection<MemoryProvider>

Source

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.

Source

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.

Source

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.

Source

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>

Source

pub async fn hold_next_access( &self, account: &str, grant: bool, started: Sender<()>, resume: Receiver<()>, )

Hold one account request before it reaches the provider’s grant state.

Source§

impl StorageConnection<MemoryProvider>

Source

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.

Source

pub async fn plant_location_marker(&self, bytes: Option<Vec<u8>>)

Replace or remove the location marker as an external actor, without a request.

Source

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.

Source

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).

Source

pub fn with_cooldown(&self, cooldown: Arc<dyn Cooldown>) -> Self

Bind this connection to the store’s shared provider cooldown.

Source

pub fn with_transfers(&self, transfers: Arc<TransferBudget>) -> Self

Use the handle’s transfer budget on this simulated connection.

Source

pub fn shared_connection(&self) -> Arc<StorageConnection>

Erase the provider type while retaining this exact connection’s credentials.

Source§

impl StorageConnection<MemoryProvider>

Source

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.

Source

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.

Source

pub fn for_device(&self) -> Self

Another device connected to the same durable backend, with independent credentials, request notifications and network availability.

Source

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.

Source

pub fn set_online(&self, online: bool)

Set this connection’s network availability without changing other devices.

Source

pub fn subscribe_requests(&self) -> RequestWatch

Request notifications include failed attempts, so tests can wait without polling.

Source

pub fn peak_requests(&self) -> usize

Greatest number of requests overlapping an injected delay or barrier.

Source

pub fn reset_request_peak(&self)

Reset the peak for subsequent request starts, retaining active requests.

Source

pub fn request_count(&self) -> u64

Every attempted provider request, including injected failures.

Source

pub async fn s3_credentials(&self) -> Option<S3Credentials>

The key currently installed on this simulated provider connection.

Source

pub async fn s3_access_key_id(&self) -> Option<String>

The most recently installed S3 access-key id, without exposing its secret.

Source

pub async fn ranges(&self) -> Vec<ByteRange>

Opened ranged responses, in order.

Source

pub async fn reads(&self) -> Vec<(ObjectPath, u64, u64)>

Opened responses as (path, offset, declared byte count), including whole objects.

Source

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.

Source

pub async fn transferred(&self) -> (u64, usize)

Part bytes with successful replies and their largest buffer, across sessions.

Source

pub async fn corrupt_byte( &self, path: &ObjectPath, offset: usize, ) -> Result<(), StorageError>

Damage one stored byte without issuing a provider request.

Source

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).

Source

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.

Source

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).

Source

pub async fn set_faults(&self, faults: Faults)

Set faults absolutely, so repeating the command has the same effect.

Source

pub async fn hold_creations(&self, barrier: Arc<Barrier>)

Hold each create, including injected failures, until all writers arrive at the test’s barrier.

Source

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.

Source

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.

Source

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.

Source

pub async fn shared_with(&self, account: &str) -> bool

Whether the store is shared with account: granted and not since revoked.

Source

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.

Source

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>

Source

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.

Source

pub fn requests(&self) -> RequestCounts

Every request this connection has sent so far, by kind.

Source

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>

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,

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

This provider’s nonsecret location settings.
Source§

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

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.
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,

Install a member’s replacement S3 key after credential custody commits. Other provider kinds refuse this operation without changing sign-in state.
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,

Install replacement OAuth tokens after the owner commits them to key custody. S3 and CloudKit refuse OAuth tokens; they use different account credentials.
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,

The signed-in sharing account, for the member’s admin access entry. S3 uses its supplied access key id instead of an account lookup.
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,

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.
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,

Exact lookup. None means confirmed absence; failed lookups remain errors. Pending multipart assets must not be reported as complete objects.
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,

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,

List every object under the prefix, across all pages. Missing or malformed metadata fails the call.
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,

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.
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,

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.
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,

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.
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,

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).
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,

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. Read more
Source§

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. Read more
Source§

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.
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,

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.
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,

Begin a create-once upload, returning the value to record before parts are sent. This also creates an absent floor without exposing partial bytes.
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,

Begin a floor upload bound to this observed native revision. Record it before sending parts; restarting never adopts a newer revision.
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,

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.
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,

Refresh a recorded session from the provider after interruption. Persist the returned state even on failure, as with finish_upload.
Source§

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).
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,

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.
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,

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.
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,

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.
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,

Explicitly abandon an upload. Dropping a recorded value does not abort it. Already closed or absent sessions succeed; published objects are preserved.
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,

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).
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,

Read bytes and metadata from the same object revision. A range still reports the complete encrypted size and whole-object checksum semantics.
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,

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.
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,

Read a bounded whole encrypted object; the limit is the same as 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,

Fetch only the requested bytes; never silently shorten a range.
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,

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,

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.

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>
where P: Sync + Send + ?Sized,

§

impl<P> Sync for StorageConnection<P>
where P: Sync + Send + ?Sized,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

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