pub struct MetadataBuilder { /* private fields */ }Expand description
Mutable construction state for Metadata.
Implementations§
Source§impl MetadataBuilder
impl MetadataBuilder
Sourcepub fn file(content_length: u64) -> Self
pub fn file(content_length: u64) -> Self
Create a builder for file metadata with its complete content length.
Sourcepub fn set_file(&mut self, content_length: u64) -> &mut Self
pub fn set_file(&mut self, content_length: u64) -> &mut Self
Set the entry mode to file and replace its complete content length.
Sourcepub fn set_dir(&mut self) -> &mut Self
pub fn set_dir(&mut self) -> &mut Self
Set the entry mode to directory and discard any file content length.
Sourcepub fn set_unknown(&mut self) -> &mut Self
pub fn set_unknown(&mut self) -> &mut Self
Set the entry mode to unknown and discard any file content length.
Sourcepub fn is_current(&mut self, value: Option<bool>) -> &mut Self
pub fn is_current(&mut self, value: Option<bool>) -> &mut Self
Set whether this metadata describes the current object version.
Sourcepub fn is_deleted(&mut self, value: bool) -> &mut Self
pub fn is_deleted(&mut self, value: bool) -> &mut Self
Set whether this metadata describes a deleted object.
Sourcepub fn cache_control(&mut self, value: impl Into<String>) -> &mut Self
pub fn cache_control(&mut self, value: impl Into<String>) -> &mut Self
Set the Cache-Control value.
Sourcepub fn content_md5(&mut self, value: impl Into<String>) -> &mut Self
pub fn content_md5(&mut self, value: impl Into<String>) -> &mut Self
Set the Content-MD5 value.
Sourcepub fn content_type(&mut self, value: impl Into<String>) -> &mut Self
pub fn content_type(&mut self, value: impl Into<String>) -> &mut Self
Set the Content-Type value.
Sourcepub fn content_encoding(&mut self, value: impl Into<String>) -> &mut Self
pub fn content_encoding(&mut self, value: impl Into<String>) -> &mut Self
Set the Content-Encoding value.
Sourcepub fn last_modified(&mut self, value: Timestamp) -> &mut Self
pub fn last_modified(&mut self, value: Timestamp) -> &mut Self
Set the last-modified timestamp.
Sourcepub fn content_disposition(&mut self, value: impl Into<String>) -> &mut Self
pub fn content_disposition(&mut self, value: impl Into<String>) -> &mut Self
Set the Content-Disposition value.
Sourcepub fn user_metadata(
&mut self,
values: impl IntoIterator<Item = (String, String)>,
) -> &mut Self
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.