Struct opendal::ObjectEntry
source · [−]pub struct ObjectEntry { /* private fields */ }
Expand description
ObjectEntry is returned by ObjectStream
or ObjectIterate
during object list.
Users can check returning object entry’s mode or convert into an object without overhead.
Implementations
sourceimpl ObjectEntry
impl ObjectEntry
sourcepub fn new(
acc: Arc<dyn Accessor>,
path: &str,
meta: ObjectMetadata
) -> ObjectEntry
pub fn new(
acc: Arc<dyn Accessor>,
path: &str,
meta: ObjectMetadata
) -> ObjectEntry
Create a new object entry by its corresponding underlying storage.
sourcepub fn set_accessor(&mut self, acc: Arc<dyn Accessor>)
pub fn set_accessor(&mut self, acc: Arc<dyn Accessor>)
Set accessor for this entry.
sourcepub fn set_complete(&mut self) -> &mut Self
pub fn set_complete(&mut self) -> &mut Self
Complete means this object entry already carries all metadata that it could have. Don’t call metadata anymore.
sourcepub fn with_complete(self) -> Self
pub fn with_complete(self) -> Self
Complete means this object entry already carries all metadata that it could have. Don’t call metadata anymore.
sourcepub fn into_object(self) -> Object
pub fn into_object(self) -> Object
Convert ObjectEntry
into Object
.
This function is the same with already implemented From
trait.
This function will make our users happier to avoid writing
generic type parameter
sourcepub fn mode(&self) -> ObjectMode
pub fn mode(&self) -> ObjectMode
Return this object entry’s object mode.
sourcepub fn id(&self) -> String
pub fn id(&self) -> String
Return this object entry’s id.
The same with Object::id()
sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
Return this object entry’s path.
The same with Object::path()
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Return this object entry’s name.
The same with Object::name()
sourcepub async fn metadata(&self) -> ObjectMetadata
pub async fn metadata(&self) -> ObjectMetadata
Fetch metadata about this object entry.
sourcepub fn blocking_metadata(&self) -> ObjectMetadata
pub fn blocking_metadata(&self) -> ObjectMetadata
Fetch metadata about this object entry.
The same with Object::blocking_metadata()
sourcepub fn set_metadata(&self, meta: ObjectMetadata) -> &Self
pub fn set_metadata(&self, meta: ObjectMetadata) -> &Self
Update ObjectEntry’s metadata by setting new one.
sourcepub async fn content_length(&self) -> u64
pub async fn content_length(&self) -> u64
The size of ObjectEntry
’s corresponding object
content_length
is a prefetched metadata field in ObjectEntry
.
sourcepub async fn content_md5(&self) -> Option<String>
pub async fn content_md5(&self) -> Option<String>
The MD5 message digest of ObjectEntry
’s corresponding object
content_md5
is a prefetched metadata field in ObjectEntry
It doesn’t mean this metadata field of object doesn’t exist if content_md5
is None
.
Then you have to call ObjectEntry::metadata()
to get the metadata you want.
sourcepub async fn last_modified(&self) -> Option<OffsetDateTime>
pub async fn last_modified(&self) -> Option<OffsetDateTime>
The last modified UTC datetime of ObjectEntry
’s corresponding object
last_modified
is a prefetched metadata field in ObjectEntry
It doesn’t mean this metadata field of object doesn’t exist if last_modified
is None
.
Then you have to call ObjectEntry::metadata()
to get the metadata you want.
sourcepub async fn etag(&self) -> Option<String>
pub async fn etag(&self) -> Option<String>
The ETag string of ObjectEntry
’s corresponding object
etag
is a prefetched metadata field in ObjectEntry
.
It doesn’t mean this metadata field of object doesn’t exist if etag
is None
.
Then you have to call ObjectEntry::metadata()
to get the metadata you want.
Trait Implementations
sourceimpl Clone for ObjectEntry
impl Clone for ObjectEntry
sourceimpl Debug for ObjectEntry
impl Debug for ObjectEntry
sourceimpl From<ObjectEntry> for Object
impl From<ObjectEntry> for Object
ObjectEntry can convert into object without overhead.