pub struct Metadata { /* private fields */ }Expand description
Metadata contains all the information related to a specific path.
Metadata is tied to the operation that produced it. The same path can have different metadata across versions or requests.
§File versions
In systems that support versioning, metadata can represent a specific object
version. Metadata::version returns its version identifier when available.
Metadata::is_current and Metadata::is_deleted describe whether that
version is current or deleted.
is_current | is_deleted | Meaning |
|---|---|---|
Some(true) | false | The current object version. |
Some(true) | true | The current delete marker or soft-deleted version. |
Some(false) | false | A previous accessible version. |
Some(false) | true | A previous deleted version. |
None | false | A non-deleted object whose current-version status is unknown. |
None | true | A deleted object whose current-version status is unknown. |
Metadata is an immutable owned value. Use MetadataBuilder to create a
value and Metadata::into_builder to create a modified value.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn into_builder(self) -> MetadataBuilder
pub fn into_builder(self) -> MetadataBuilder
Consume this metadata and return a builder initialized with its values.
Sourcepub fn is_current(&self) -> Option<bool>
pub fn is_current(&self) -> Option<bool>
Return whether this metadata describes the current object version.
None means the service did not report whether the version is current.
Sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
Return whether this metadata describes a deleted object or delete marker.
Sourcepub fn cache_control(&self) -> Option<&str>
pub fn cache_control(&self) -> Option<&str>
Return this entry’s Cache-Control value.
See RFC 9111.
Sourcepub fn content_length(&self) -> u64
pub fn content_length(&self) -> u64
Return the full content length of this entry.
For file metadata returned by stat, list, or read operations, this value is the complete object size even when a read returns only a range. Directory and unknown metadata return zero.
Sourcepub fn content_md5(&self) -> Option<&str>
pub fn content_md5(&self) -> Option<&str>
Return this entry’s Content-MD5 value.
OpenDAL returns the service-provided value and does not guarantee that it is the MD5 digest of the content.
Sourcepub fn content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
Return this entry’s Content-Type value.
See RFC 9110.
Sourcepub fn content_encoding(&self) -> Option<&str>
pub fn content_encoding(&self) -> Option<&str>
Return this entry’s Content-Encoding value.
See RFC 9110.
Sourcepub fn last_modified(&self) -> Option<Timestamp>
pub fn last_modified(&self) -> Option<Timestamp>
Return this entry’s Last-Modified timestamp.
See RFC 9110.
Sourcepub fn etag(&self) -> Option<&str>
pub fn etag(&self) -> Option<&str>
Return this entry’s service-provided ETag as-is.
Quotes and weak-validator prefixes are part of the returned value. See RFC 9110.
Sourcepub fn content_disposition(&self) -> Option<&str>
pub fn content_disposition(&self) -> Option<&str>
Return this entry’s Content-Disposition value.
See RFC 6266.
Sourcepub fn user_metadata(&self) -> Option<UserMetadata<'_>>
pub fn user_metadata(&self) -> Option<UserMetadata<'_>>
Return a borrowed view of this entry’s user metadata.
Service-specific metadata prefixes are removed from the returned keys.