pub struct ObjectClient { /* private fields */ }
Expand description
对象操作客户端
Implementations§
Source§impl ObjectClient
impl ObjectClient
Sourcepub async fn put_object(
&self,
key: &str,
data: Vec<u8>,
content_type: Option<&str>,
) -> Result<PutObjectResponse>
pub async fn put_object( &self, key: &str, data: Vec<u8>, content_type: Option<&str>, ) -> Result<PutObjectResponse>
上传对象
Sourcepub async fn put_object_from_file(
&self,
key: &str,
file_path: &Path,
content_type: Option<&str>,
) -> Result<PutObjectResponse>
pub async fn put_object_from_file( &self, key: &str, file_path: &Path, content_type: Option<&str>, ) -> Result<PutObjectResponse>
从文件上传对象
Sourcepub async fn get_object(&self, key: &str) -> Result<GetObjectResponse>
pub async fn get_object(&self, key: &str) -> Result<GetObjectResponse>
获取对象
Sourcepub async fn delete_object(&self, key: &str) -> Result<DeleteObjectResponse>
pub async fn delete_object(&self, key: &str) -> Result<DeleteObjectResponse>
删除对象
Sourcepub async fn delete_objects(
&self,
keys: &[String],
) -> Result<DeleteObjectsResponse>
pub async fn delete_objects( &self, keys: &[String], ) -> Result<DeleteObjectsResponse>
批量删除对象
Sourcepub async fn head_object(&self, key: &str) -> Result<HeadObjectResponse>
pub async fn head_object(&self, key: &str) -> Result<HeadObjectResponse>
获取对象元数据
Sourcepub async fn object_exists(&self, key: &str) -> Result<bool>
pub async fn object_exists(&self, key: &str) -> Result<bool>
检查对象是否存在
Trait Implementations§
Source§impl Clone for ObjectClient
impl Clone for ObjectClient
Source§fn clone(&self) -> ObjectClient
fn clone(&self) -> ObjectClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ObjectClient
impl !RefUnwindSafe for ObjectClient
impl Send for ObjectClient
impl Sync for ObjectClient
impl Unpin for ObjectClient
impl !UnwindSafe for ObjectClient
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
Mutably borrows from an owned value. Read more