#[non_exhaustive]pub struct WriteMetadata {
pub content_type: Option<String>,
pub content_encoding: Option<String>,
pub expiration: Option<String>,
pub origin: Option<String>,
pub filename: Option<String>,
pub custom: BTreeMap<String, String>,
}Expand description
The writable subset of Metadata, as sent in JSON when inserting an object.
Values use their header syntax, for example "zstd" or "ttl:30d", and are validated by
into_metadata. Unknown fields are ignored.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.content_type: Option<String>§content_encoding: Option<String>§expiration: Option<String>§origin: Option<String>See Metadata::origin.
filename: Option<String>See Metadata::filename.
custom: BTreeMap<String, String>See Metadata::custom.
Implementations§
Source§impl WriteMetadata
impl WriteMetadata
Sourcepub fn into_metadata(self, access_time: Timestamp) -> Result<Metadata, Error>
pub fn into_metadata(self, access_time: Timestamp) -> Result<Metadata, Error>
Validates the fields and converts them into Metadata for an object written at
access_time.
Sets the creation and expiration times like Metadata::from_insert_headers. Custom keys
are normalized with normalize_custom_key.
§Errors
Returns an error if a value is invalid.
Trait Implementations§
Source§impl Clone for WriteMetadata
impl Clone for WriteMetadata
Source§impl Debug for WriteMetadata
impl Debug for WriteMetadata
Source§impl Default for WriteMetadata
impl Default for WriteMetadata
Source§impl<'de> Deserialize<'de> for WriteMetadatawhere
WriteMetadata: Default,
impl<'de> Deserialize<'de> for WriteMetadatawhere
WriteMetadata: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for WriteMetadata
Source§impl From<Metadata> for WriteMetadata
impl From<Metadata> for WriteMetadata
Source§impl PartialEq for WriteMetadata
impl PartialEq for WriteMetadata
Source§impl Serialize for WriteMetadata
impl Serialize for WriteMetadata
impl StructuralPartialEq for WriteMetadata
Auto Trait Implementations§
impl Freeze for WriteMetadata
impl RefUnwindSafe for WriteMetadata
impl Send for WriteMetadata
impl Sync for WriteMetadata
impl Unpin for WriteMetadata
impl UnsafeUnpin for WriteMetadata
impl UnwindSafe for WriteMetadata
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
Mutably borrows from an owned value. Read more