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§
source§impl ObjectMetadata
impl ObjectMetadata
sourcepub fn new(mode: ObjectMode) -> Self
pub fn new(mode: ObjectMode) -> Self
Create a new object metadata
sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
If this object metadata if complete
sourcepub fn set_complete(&mut self) -> &mut Self
pub fn set_complete(&mut self) -> &mut Self
Make this object metadata if complete.
sourcepub fn with_complete(self) -> Self
pub fn with_complete(self) -> Self
Make this object metadata if complete.
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 content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
Content Type of this object.
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 object.
Content Type is defined by RFC 9110.
sourcepub fn with_content_type(self, v: &str) -> Self
pub fn with_content_type(self, v: &str) -> Self
Set Content Type of this object.
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 object.
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 object.
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 object.
Content Range is defined by RFC 9110.
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§
source§impl Clone for ObjectMetadata
impl Clone for ObjectMetadata
source§fn clone(&self) -> ObjectMetadata
fn clone(&self) -> ObjectMetadata
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ObjectMetadata
impl Debug for ObjectMetadata
source§impl<'de> Deserialize<'de> for ObjectMetadata
impl<'de> Deserialize<'de> for ObjectMetadata
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>,
source§impl PartialEq<ObjectMetadata> for ObjectMetadata
impl PartialEq<ObjectMetadata> for ObjectMetadata
source§fn eq(&self, other: &ObjectMetadata) -> bool
fn eq(&self, other: &ObjectMetadata) -> bool
source§impl 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§
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.