Skip to main content

Metadata

Struct Metadata 

Source
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_currentis_deletedMeaning
Some(true)falseThe current object version.
Some(true)trueThe current delete marker or soft-deleted version.
Some(false)falseA previous accessible version.
Some(false)trueA previous deleted version.
NonefalseA non-deleted object whose current-version status is unknown.
NonetrueA 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

Source

pub fn into_builder(self) -> MetadataBuilder

Consume this metadata and return a builder initialized with its values.

Source

pub fn mode(&self) -> EntryMode

Return this entry’s mode.

Source

pub fn is_file(&self) -> bool

Return true if this metadata is for a file.

Source

pub fn is_dir(&self) -> bool

Return true if this metadata is for a directory.

Source

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.

Source

pub fn is_deleted(&self) -> bool

Return whether this metadata describes a deleted object or delete marker.

Source

pub fn cache_control(&self) -> Option<&str>

Return this entry’s Cache-Control value.

See RFC 9111.

Source

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.

Source

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.

Source

pub fn content_type(&self) -> Option<&str>

Return this entry’s Content-Type value.

See RFC 9110.

Source

pub fn content_encoding(&self) -> Option<&str>

Return this entry’s Content-Encoding value.

See RFC 9110.

Source

pub fn last_modified(&self) -> Option<Timestamp>

Return this entry’s Last-Modified timestamp.

See RFC 9110.

Source

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.

Source

pub fn content_disposition(&self) -> Option<&str>

Return this entry’s Content-Disposition value.

See RFC 6266.

Source

pub fn version(&self) -> Option<&str>

Return this entry’s service-specific version identifier.

Source

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.

Trait Implementations§

Source§

impl Clone for Metadata

Source§

fn clone(&self) -> Metadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Metadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Metadata

Source§

impl PartialEq for Metadata

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.