pub struct OssFileApi {
pub api_settings: ApiSettings,
}Expand description
OSS FILE API
Fields§
§api_settings: ApiSettingsImplementations§
Source§impl OssFileApi
impl OssFileApi
Sourcepub async fn upload_file(
&self,
bucket: &str,
file_path: &str,
file_name: &str,
) -> Result<Ro<Value>, Box<dyn Error + Send + Sync>>
pub async fn upload_file( &self, bucket: &str, file_path: &str, file_name: &str, ) -> Result<Ro<Value>, Box<dyn Error + Send + Sync>>
Sourcepub async fn upload_file_content(
&self,
bucket: &str,
file_name: &str,
data: Vec<u8>,
) -> Result<Ro<Value>, Box<dyn Error + Send + Sync>>
pub async fn upload_file_content( &self, bucket: &str, file_name: &str, data: Vec<u8>, ) -> Result<Ro<Value>, Box<dyn Error + Send + Sync>>
Trait Implementations§
Source§impl BaseApi for OssFileApi
impl BaseApi for OssFileApi
fn get_api_settings(&self) -> &ApiSettings
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
执行GET请求的通用方法
Source§fn get_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn get_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
执行GET请求的通用方法,返回bytes
Source§fn post<'life0, 'life1, 'life2, 'async_trait, B>(
&'life0 self,
path: &'life1 str,
body: &'life2 B,
) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
fn post<'life0, 'life1, 'life2, 'async_trait, B>( &'life0 self, path: &'life1 str, body: &'life2 B, ) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
执行POST请求的通用方法
Source§fn put<'life0, 'life1, 'life2, 'async_trait, B>(
&'life0 self,
path: &'life1 str,
body: &'life2 B,
) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
fn put<'life0, 'life1, 'life2, 'async_trait, B>( &'life0 self, path: &'life1 str, body: &'life2 B, ) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
执行PUT请求的通用方法
Source§fn delete<'life0, 'life1, 'async_trait, B>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
fn delete<'life0, 'life1, 'async_trait, B>( &'life0 self, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
执行DELETE请求的通用方法
Source§fn multipart<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
form: Form,
) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn multipart<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
form: Form,
) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
执行post multipart请求的通用方法
Source§fn multipart_with_current_user_id<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
form: Form,
current_user_id: u64,
) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn multipart_with_current_user_id<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
form: Form,
current_user_id: u64,
) -> Pin<Box<dyn Future<Output = Result<Ro<Value>, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
执行post multipart请求带当前用户ID的方法
Auto Trait Implementations§
impl Freeze for OssFileApi
impl RefUnwindSafe for OssFileApi
impl Send for OssFileApi
impl Sync for OssFileApi
impl Unpin for OssFileApi
impl UnwindSafe for OssFileApi
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