pub struct InitiateMultipartBuilder { /* private fields */ }Expand description
A builder for initiating a multipart upload.
Implementations§
Source§impl InitiateMultipartBuilder
impl InitiateMultipartBuilder
Sourcepub fn key(self, key: impl Into<ObjectKey>) -> Self
pub fn key(self, key: impl Into<ObjectKey>) -> Self
Sets an explicit object key.
If a key is specified, the object will be stored under that key. Otherwise, the Objectstore server will automatically assign a random key, which is then returned from this request.
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.
IMPORTANT: unlike single-object uploads, the client does not automatically compress the
contents of MultipartUpload::put/MultipartUpload::put_stream based on the
configured compression.
The caller is responsible to compress the payload in accordance with the configured
compression.
By default, the compression algorithm set on this Session’s Usecase is used.
Sourcepub fn expiration_policy(self, expiration_policy: ExpirationPolicy) -> Self
pub fn expiration_policy(self, expiration_policy: ExpirationPolicy) -> Self
Sets the expiration policy of the object to be uploaded.
By default, the expiration policy set on this Session’s Usecase is used.
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 content type of the object to be uploaded.
You can use the utility function crate::utils::guess_mime_type to attempt to guess a
content_type based on magic bytes.
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.
This is an optional but encouraged field that tracks where the payload was originally obtained from. For example, the IP address of the Sentry SDK or CLI that uploaded the data.
§Example
session.initiate_multipart_upload()
.origin("203.0.113.42")
.send()
.await
.unwrap();Sourcepub fn set_metadata(self, metadata: impl Into<BTreeMap<String, String>>) -> Self
pub fn set_metadata(self, metadata: impl Into<BTreeMap<String, String>>) -> Self
Sets the custom metadata to the provided map.
It will clear any previously set metadata.
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
Appends the key/value to the custom metadata of this object.
Sourcepub async fn send(self) -> Result<MultipartUpload>
pub async fn send(self) -> Result<MultipartUpload>
Sends the initiate request and returns a MultipartUpload handle.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InitiateMultipartBuilder
impl !RefUnwindSafe for InitiateMultipartBuilder
impl Send for InitiateMultipartBuilder
impl Sync for InitiateMultipartBuilder
impl Unpin for InitiateMultipartBuilder
impl UnsafeUnpin for InitiateMultipartBuilder
impl !UnwindSafe for InitiateMultipartBuilder
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<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