Struct opendal::ObjectMetadata
source · [−]pub struct ObjectMetadata { /* private fields */ }
Expand description
Metadata carries all object metadata.
Notes
mode and content_length are required metadata that all services
should provide during stat
operation. But in list
operation,
a.k.a., ObjectEntry
’s content length could be None
.
Implementations
sourceimpl ObjectMetadata
impl ObjectMetadata
sourcepub fn new(mode: ObjectMode) -> Self
pub fn new(mode: ObjectMode) -> Self
Create a new object metadata
sourcepub fn mode(&self) -> ObjectMode
pub fn mode(&self) -> ObjectMode
Object mode represent this object’s mode.
sourcepub fn set_mode(&mut self, mode: ObjectMode) -> &mut Self
pub fn set_mode(&mut self, mode: ObjectMode) -> &mut Self
Set mode for object.
sourcepub fn with_mode(self, mode: ObjectMode) -> Self
pub fn with_mode(self, mode: ObjectMode) -> Self
Set mode for object.
sourcepub fn content_length(&self) -> u64
pub fn content_length(&self) -> u64
Content length of this object.
Content-Length
is defined by RFC 7230
Refer to MDN Content-Length for more information.
sourcepub fn set_content_length(&mut self, content_length: u64) -> &mut Self
pub fn set_content_length(&mut self, content_length: u64) -> &mut Self
Set content length of this object.
sourcepub fn with_content_length(self, content_length: u64) -> Self
pub fn with_content_length(self, content_length: u64) -> Self
Set content length of this object.
sourcepub fn content_md5(&self) -> Option<&str>
pub fn content_md5(&self) -> Option<&str>
sourcepub fn set_content_md5(&mut self, content_md5: &str) -> &mut Self
pub fn set_content_md5(&mut self, content_md5: &str) -> &mut Self
sourcepub fn with_content_md5(self, content_md5: &str) -> Self
pub fn with_content_md5(self, content_md5: &str) -> Self
sourcepub fn last_modified(&self) -> Option<OffsetDateTime>
pub fn last_modified(&self) -> Option<OffsetDateTime>
Last modified of this object.
Last-Modified
is defined by RFC 7232
Refer to MDN Last-Modified for more information.
OpenDAL parse the raw value into OffsetDateTime
for convenient.
sourcepub fn set_last_modified(&mut self, last_modified: OffsetDateTime) -> &mut Self
pub fn set_last_modified(&mut self, last_modified: OffsetDateTime) -> &mut Self
Set Last modified of this object.
Last-Modified
is defined by RFC 7232
Refer to MDN Last-Modified for more information.
sourcepub fn with_last_modified(self, last_modified: OffsetDateTime) -> Self
pub fn with_last_modified(self, last_modified: OffsetDateTime) -> Self
Set Last modified of this object.
Last-Modified
is defined by RFC 7232
Refer to MDN Last-Modified for more information.
Trait Implementations
sourceimpl Clone for ObjectMetadata
impl Clone for ObjectMetadata
sourcefn clone(&self) -> ObjectMetadata
fn clone(&self) -> ObjectMetadata
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ObjectMetadata
impl Debug for ObjectMetadata
sourceimpl<'de> Deserialize<'de> for ObjectMetadata
impl<'de> Deserialize<'de> for ObjectMetadata
sourcefn 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>,
sourceimpl PartialEq<ObjectMetadata> for ObjectMetadata
impl PartialEq<ObjectMetadata> for ObjectMetadata
sourcefn eq(&self, other: &ObjectMetadata) -> bool
fn eq(&self, other: &ObjectMetadata) -> bool
sourceimpl Serialize for ObjectMetadata
impl Serialize for ObjectMetadata
impl Eq for ObjectMetadata
impl StructuralEq for ObjectMetadata
impl StructuralPartialEq for ObjectMetadata
Auto Trait Implementations
impl RefUnwindSafe for ObjectMetadata
impl Send for ObjectMetadata
impl Sync for ObjectMetadata
impl Unpin for ObjectMetadata
impl UnwindSafe for ObjectMetadata
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<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,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.