pub enum CompleteUploadRequest {
ContentRef {
content_ref: ContentRef,
},
Multipart {
multipart: DirectMultipartContentClaim,
parts: Vec<CompletedUploadPart>,
},
}Expand description
Request to complete an upload, tagged by which of its two shapes it is.
The shapes correspond to who knew the content identity first. A
service-proxied or direct_put session was handed its reference before
any byte moved, so its completion names that reference back. A
direct_multipart session was never told one — there was nothing to
tell — so its completion carries the claim and its parts instead, and
the server builds the reference from the identity it has held all along.
The two share no fields, so a completion carrying one shape’s fields under the other’s tag does not decode. What decoding cannot settle is whether the shape matches the session, because only the server knows which transport the session was opened with; that one check is made against the durable record.
Variants§
ContentRef
Completes a session the server named a content object for: the caller names it back and the server proves the object matches.
Fields
content_ref: ContentRefContent identity the caller expects the session to have settled on.
Multipart
Completes a direct_multipart session with what it uploaded.
Fields
multipart: DirectMultipartContentClaimThe assembled object’s length and CRC-64/NVME, which completion verifies against the provider’s own reading of the object.
parts: Vec<CompletedUploadPart>Every part the client uploaded, in ascending part order. The server holds no part records of its own, so this list is what it assembles the object from.
Implementations§
Source§impl CompleteUploadRequest
impl CompleteUploadRequest
Sourcepub fn for_content_ref(content_ref: ContentRef) -> Self
pub fn for_content_ref(content_ref: ContentRef) -> Self
Completes a session that already knows its content reference.
Sourcepub fn for_multipart(
claim: DirectMultipartContentClaim,
parts: Vec<CompletedUploadPart>,
) -> Self
pub fn for_multipart( claim: DirectMultipartContentClaim, parts: Vec<CompletedUploadPart>, ) -> Self
Completes a direct_multipart session with what it assembled.
Trait Implementations§
Source§impl Clone for CompleteUploadRequest
impl Clone for CompleteUploadRequest
Source§fn clone(&self) -> CompleteUploadRequest
fn clone(&self) -> CompleteUploadRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more