pub struct UploadIfMatchRequest<'a, T: ?Sized = Bucket> {
pub key: String,
pub data: UploadBody,
pub revision: Revision,
pub content_type: Option<String>,
pub cache_control: Option<String>,
pub content_disposition: Option<String>,
pub metadata: BTreeMap<String, String>,
pub storage_class: Option<StorageClass>,
pub retain_until: Option<SystemTime>,
/* private fields */
}Expand description
The upload Bucket::upload_if_match makes: set its options with its
methods, then await it. Returns the object’s stored attributes.
It takes an upload’s options but not_exists:
async fn upload(seen: Revision) {
let _ = UPLOADS.upload_if_match("a", vec![], seen).not_exists().await;
}Its fields are what the request asks for, for a fake IfMatchUploader
to read.
Fields§
§key: String§data: UploadBody§revision: Revision§content_type: Option<String>§cache_control: Option<String>§content_disposition: Option<String>§metadata: BTreeMap<String, String>§storage_class: Option<StorageClass>§retain_until: Option<SystemTime>Implementations§
Source§impl<'a, T: ?Sized> UploadIfMatchRequest<'a, T>
impl<'a, T: ?Sized> UploadIfMatchRequest<'a, T>
Sourcepub fn content_type(self, content_type: impl Into<String>) -> Self
pub fn content_type(self, content_type: impl Into<String>) -> Self
The object’s content type, such as application/pdf.
Sourcepub fn cache_control(self, cache_control: impl Into<String>) -> Self
pub fn cache_control(self, cache_control: impl Into<String>) -> Self
The Cache-Control the object is served with, such as
public, max-age=3600.
Sourcepub fn content_disposition(self, content_disposition: impl Into<String>) -> Self
pub fn content_disposition(self, content_disposition: impl Into<String>) -> Self
The Content-Disposition the object is served with, such as
attachment; filename="a.pdf".
Sourcepub fn metadata<K, V>(self, metadata: impl IntoIterator<Item = (K, V)>) -> Self
pub fn metadata<K, V>(self, metadata: impl IntoIterator<Item = (K, V)>) -> Self
Adds custom metadata, replacing that of the same names: a map, or
pairs such as [("owner", "42")]. Keys are lowercase letters,
digits, - and _, not starting with - or _; values are
printable ASCII.
Sourcepub fn storage_class(self, class: StorageClass) -> Self
pub fn storage_class(self, class: StorageClass) -> Self
The object’s storage class, rather than the bucket’s. Never
StorageClass::Auto, which is a bucket’s class only.
Sourcepub fn retain_until(self, until: SystemTime) -> Self
pub fn retain_until(self, until: SystemTime) -> Self
Keeps the object until until at least, in a bucket declared with
Bucket::object_retention.
Trait Implementations§
Source§impl<'a> IntoFuture for UploadIfMatchRequest<'a, Bucket>
impl<'a> IntoFuture for UploadIfMatchRequest<'a, Bucket>
Source§type Output = Result<ObjectAttrs, Error>
type Output = Result<ObjectAttrs, Error>
Source§type IntoFuture = Pin<Box<dyn Future<Output = <UploadIfMatchRequest<'a> as IntoFuture>::Output> + Send + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = <UploadIfMatchRequest<'a> as IntoFuture>::Output> + Send + 'a>>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Source§impl<'a, T: IfMatchUploader + ?Sized> IntoFuture for UploadIfMatchRequest<'a, T>
impl<'a, T: IfMatchUploader + ?Sized> IntoFuture for UploadIfMatchRequest<'a, T>
Source§type Output = Result<ObjectAttrs, Error>
type Output = Result<ObjectAttrs, Error>
Source§type IntoFuture = Pin<Box<dyn Future<Output = <UploadIfMatchRequest<'a, T> as IntoFuture>::Output> + Send + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = <UploadIfMatchRequest<'a, T> as IntoFuture>::Output> + Send + 'a>>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Auto Trait Implementations§
impl<'a, T = Bucket> !Freeze for UploadIfMatchRequest<'a, T>
impl<'a, T = Bucket> !RefUnwindSafe for UploadIfMatchRequest<'a, T>
impl<'a, T = Bucket> !UnwindSafe for UploadIfMatchRequest<'a, T>
impl<'a, T> Forget for UploadIfMatchRequest<'a, T>where
T: ?Sized,
impl<'a, T> Move for UploadIfMatchRequest<'a, T>where
T: ?Sized,
impl<'a, T> Send for UploadIfMatchRequest<'a, T>
impl<'a, T> Sync for UploadIfMatchRequest<'a, T>
impl<'a, T> Unpin for UploadIfMatchRequest<'a, T>
impl<'a, T> UnsafeUnpin for UploadIfMatchRequest<'a, T>
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request