pub struct CreateResumableUploadBuilder { /* private fields */ }Expand description
A builder for Session::create_upload.
Implementations§
Source§impl CreateResumableUploadBuilder
impl CreateResumableUploadBuilder
Sourcepub fn key(self, key: impl Into<ObjectKey>) -> Self
pub fn key(self, key: impl Into<ObjectKey>) -> Self
Sets an explicit object key instead of asking the server to generate one.
Sourcepub fn content_type(self, content_type: impl Into<Cow<'static, str>>) -> Self
pub fn content_type(self, content_type: impl Into<Cow<'static, str>>) -> Self
Sets the object’s content type.
Sourcepub fn expiration_policy(self, expiration_policy: ExpirationPolicy) -> Self
pub fn expiration_policy(self, expiration_policy: ExpirationPolicy) -> Self
Sets the object’s expiration policy.
Sourcepub fn compression(self, compression: impl Into<Option<Compression>>) -> Self
pub fn compression(self, compression: impl Into<Option<Compression>>) -> Self
Sets the compression algorithm recorded in this object’s metadata.
Unlike regular uploads, the client does not automatically compress chunk contents.
The caller must pre-compress the object according to compression, then create the upload
with the post-compression object_length. Offsets similarly refer to the bytes after compression.
By default, no compression is set.
Sourcepub fn origin(self, origin: impl Into<String>) -> Self
pub fn origin(self, origin: impl Into<String>) -> Self
Sets the origin of the object, typically the IP address of the original source.
Sourcepub fn filename(self, filename: impl Into<String>) -> Self
pub fn filename(self, filename: impl Into<String>) -> Self
Sets the filename recorded for the object.
Sourcepub fn set_metadata(self, metadata: impl Into<BTreeMap<String, String>>) -> Self
pub fn set_metadata(self, metadata: impl Into<BTreeMap<String, String>>) -> Self
Replaces all custom metadata for the object.
Sourcepub fn append_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn append_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Adds or replaces one custom metadata entry.
Sourcepub async fn send(self) -> Result<Option<ResumableUpload>>
pub async fn send(self) -> Result<Option<ResumableUpload>>
Creates the resumable upload and returns a handle bound to it.
Returns None when the server declines resumable uploads for this object.
Callers should fall back to a regular Session::put in that case.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CreateResumableUploadBuilder
impl !UnwindSafe for CreateResumableUploadBuilder
impl Freeze for CreateResumableUploadBuilder
impl Send for CreateResumableUploadBuilder
impl Sync for CreateResumableUploadBuilder
impl Unpin for CreateResumableUploadBuilder
impl UnsafeUnpin for CreateResumableUploadBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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