Skip to main content

MetadataBuilder

Struct MetadataBuilder 

Source
pub struct MetadataBuilder { /* private fields */ }
Expand description

Mutable construction state for Metadata.

Implementations§

Source§

impl MetadataBuilder

Source

pub fn file(content_length: u64) -> Self

Create a builder for file metadata with its complete content length.

Source

pub fn dir() -> Self

Create a builder for directory metadata.

Source

pub fn unknown() -> Self

Create a builder for metadata whose entry mode is not known.

Source

pub fn set_file(&mut self, content_length: u64) -> &mut Self

Set the entry mode to file and replace its complete content length.

Source

pub fn set_dir(&mut self) -> &mut Self

Set the entry mode to directory and discard any file content length.

Source

pub fn set_unknown(&mut self) -> &mut Self

Set the entry mode to unknown and discard any file content length.

Source

pub fn is_current(&mut self, value: Option<bool>) -> &mut Self

Set whether this metadata describes the current object version.

Source

pub fn is_deleted(&mut self, value: bool) -> &mut Self

Set whether this metadata describes a deleted object.

Source

pub fn cache_control(&mut self, value: impl Into<String>) -> &mut Self

Set the Cache-Control value.

Source

pub fn content_md5(&mut self, value: impl Into<String>) -> &mut Self

Set the Content-MD5 value.

Source

pub fn content_type(&mut self, value: impl Into<String>) -> &mut Self

Set the Content-Type value.

Source

pub fn content_encoding(&mut self, value: impl Into<String>) -> &mut Self

Set the Content-Encoding value.

Source

pub fn last_modified(&mut self, value: Timestamp) -> &mut Self

Set the last-modified timestamp.

Source

pub fn etag(&mut self, value: impl Into<String>) -> &mut Self

Set the ETag.

Source

pub fn content_disposition(&mut self, value: impl Into<String>) -> &mut Self

Set the Content-Disposition value.

Source

pub fn version(&mut self, value: impl Into<String>) -> &mut Self

Set the object version.

Source

pub fn user_metadata( &mut self, values: impl IntoIterator<Item = (String, String)>, ) -> &mut Self

Set user metadata from owned key-value pairs.

Duplicate keys are rejected because user metadata has map semantics.

§Panics

Panics when values contains duplicate keys.

Source

pub fn build(self) -> Metadata

Finish this builder as immutable metadata.

§Panics

Panics when the compact value block, including its index, exceeds u16::MAX bytes.

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.