pub struct Metadata { /* private fields */ }
Expand description
Metadata carries all metadata associated with a path.
Notes
mode and content_length are required metadata that all services
should provide during stat
operation. But in list
operation,
a.k.a., Entry
’s content length could be None
.
Implementations§
source§impl Metadata
impl Metadata
sourcepub fn cache_control(&self) -> Option<&str>
pub fn cache_control(&self) -> Option<&str>
Cache control of this entry. Cache-Control is defined by RFC 7234 Refer to MDN Cache-Control for more information.
sourcepub fn set_cache_control(&mut self, v: &str) -> &mut Self
pub fn set_cache_control(&mut self, v: &str) -> &mut Self
Set cache control of this entry.
Cache-Control is defined by RFC 7234 Refer to MDN Cache-Control for more information.
sourcepub fn with_cache_control(self, v: String) -> Self
pub fn with_cache_control(self, v: String) -> Self
Set cache control of this entry.
Cache-Control is defined by RFC 7234 Refer to MDN Cache-Control for more information.
sourcepub fn content_length(&self) -> u64
pub fn content_length(&self) -> u64
Content length of this entry.
Content-Length
is defined by RFC 7230
Refer to MDN Content-Length for more information.
sourcepub fn set_content_length(&mut self, v: u64) -> &mut Self
pub fn set_content_length(&mut self, v: u64) -> &mut Self
Set content length of this entry.
sourcepub fn with_content_length(self, v: u64) -> Self
pub fn with_content_length(self, v: u64) -> Self
Set content length of this entry.
sourcepub fn content_md5(&self) -> Option<&str>
pub fn content_md5(&self) -> Option<&str>
sourcepub fn set_content_md5(&mut self, v: &str) -> &mut Self
pub fn set_content_md5(&mut self, v: &str) -> &mut Self
sourcepub fn with_content_md5(self, v: String) -> Self
pub fn with_content_md5(self, v: String) -> Self
sourcepub fn content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
Content Type of this entry.
Content Type is defined by RFC 9110.
sourcepub fn set_content_type(&mut self, v: &str) -> &mut Self
pub fn set_content_type(&mut self, v: &str) -> &mut Self
Set Content Type of this entry.
Content Type is defined by RFC 9110.
sourcepub fn with_content_type(self, v: String) -> Self
pub fn with_content_type(self, v: String) -> Self
Set Content Type of this entry.
Content Type is defined by RFC 9110.
sourcepub fn content_range(&self) -> Option<BytesContentRange>
pub fn content_range(&self) -> Option<BytesContentRange>
Content Range of this entry.
Content Range is defined by RFC 9110.
sourcepub fn set_content_range(&mut self, v: BytesContentRange) -> &mut Self
pub fn set_content_range(&mut self, v: BytesContentRange) -> &mut Self
Set Content Range of this entry.
Content Range is defined by RFC 9110.
sourcepub fn with_content_range(self, v: BytesContentRange) -> Self
pub fn with_content_range(self, v: BytesContentRange) -> Self
Set Content Range of this entry.
Content Range is defined by RFC 9110.
sourcepub fn last_modified(&self) -> Option<DateTime<Utc>>
pub fn last_modified(&self) -> Option<DateTime<Utc>>
Last modified of this entry.
Last-Modified
is defined by RFC 7232
Refer to MDN Last-Modified for more information.
OpenDAL parse the raw value into DateTime
for convenient.
sourcepub fn set_last_modified(&mut self, v: DateTime<Utc>) -> &mut Self
pub fn set_last_modified(&mut self, v: DateTime<Utc>) -> &mut Self
Set Last modified of this entry.
Last-Modified
is defined by RFC 7232
Refer to MDN Last-Modified for more information.
sourcepub fn with_last_modified(self, v: DateTime<Utc>) -> Self
pub fn with_last_modified(self, v: DateTime<Utc>) -> Self
Set Last modified of this entry.
Last-Modified
is defined by RFC 7232
Refer to MDN Last-Modified for more information.
sourcepub fn content_disposition(&self) -> Option<&str>
pub fn content_disposition(&self) -> Option<&str>
Content-Disposition of this entry
Content-Disposition
is defined by RFC 2616 and
clarified usage in RFC 6266.
Refer to MDN Content-Disposition for more information.
OpenDAL will return this value AS-IS like the following:
- “inline”
- “attachment”
- “attachment; filename="filename.jpg"”
sourcepub fn with_content_disposition(self, v: String) -> Self
pub fn with_content_disposition(self, v: String) -> Self
Set Content-Disposition of this entry
Content-Disposition
is defined by RFC 2616 and
clarified usage in RFC 6266.
Refer to MDN Content-Disposition for more information.
OpenDAL will return this value AS-IS like the following:
- “inline”
- “attachment”
- “attachment; filename="filename.jpg"”
sourcepub fn set_content_disposition(&mut self, v: &str) -> &mut Self
pub fn set_content_disposition(&mut self, v: &str) -> &mut Self
Set Content-Disposition of this entry
Content-Disposition
is defined by RFC 2616 and
clarified usage in RFC 6266.
Refer to MDN Content-Disposition for more information.
OpenDAL will return this value AS-IS like the following:
- “inline”
- “attachment”
- “attachment; filename="filename.jpg"”
Trait Implementations§
source§impl PartialEq<Metadata> for Metadata
impl PartialEq<Metadata> for Metadata
impl Eq for Metadata
impl StructuralEq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.