pub struct StoredFile {
pub key: String,
pub size: u64,
pub content_type: String,
pub stored_at: DateTime<Utc>,
pub metadata: HashMap<String, String>,
}Expand description
Metadata about a stored file.
Fields§
§key: StringStorage key (path/identifier).
size: u64File size in bytes.
content_type: StringMIME content type.
stored_at: DateTime<Utc>When the file was stored.
metadata: HashMap<String, String>Arbitrary metadata.
Implementations§
Source§impl StoredFile
impl StoredFile
Sourcepub fn new(
key: impl Into<String>,
size: u64,
content_type: Option<&str>,
) -> Self
pub fn new( key: impl Into<String>, size: u64, content_type: Option<&str>, ) -> Self
Create stored-file metadata with default storage timestamp and empty user metadata.
Sourcepub fn with_metadata(self, metadata: HashMap<String, String>) -> Self
pub fn with_metadata(self, metadata: HashMap<String, String>) -> Self
Attach backend metadata to this stored-file descriptor.
Sourcepub fn with_stored_at(self, stored_at: DateTime<Utc>) -> Self
pub fn with_stored_at(self, stored_at: DateTime<Utc>) -> Self
Override the storage timestamp.
Trait Implementations§
Source§impl Clone for StoredFile
impl Clone for StoredFile
Source§fn clone(&self) -> StoredFile
fn clone(&self) -> StoredFile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StoredFile
impl Debug for StoredFile
Source§impl<'de> Deserialize<'de> for StoredFile
impl<'de> Deserialize<'de> for StoredFile
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
Auto Trait Implementations§
impl Freeze for StoredFile
impl RefUnwindSafe for StoredFile
impl Send for StoredFile
impl Sync for StoredFile
impl Unpin for StoredFile
impl UnsafeUnpin for StoredFile
impl UnwindSafe for StoredFile
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