pub struct UpYun {
pub bucket: String,
pub operator: String,
pub password: String,
pub timeout: u64,
pub endpoint: Endpoint,
pub client: Client,
}
Expand description
Upyun 实例
Fields§
§bucket: String
服务名称
operator: String
操作员
password: String
密码
timeout: u64
请求超时时间(默认:30s)
endpoint: Endpoint
接入点(默认为自动识别接入点)
client: Client
HTTP 客户端
Implementations§
Source§impl UpYun
impl UpYun
Sourcepub async fn rm(&self, path: &str) -> Result<(), Box<dyn Error>>
pub async fn rm(&self, path: &str) -> Result<(), Box<dyn Error>>
删除目录或文件
path 可以是目录或文件路径,如果是目录,只允许删除空的目录,否则删除请求会被拒绝
Sourcepub async fn file_info(
&self,
path_to_file: &str,
) -> Result<FileInfo, Box<dyn Error>>
pub async fn file_info( &self, path_to_file: &str, ) -> Result<FileInfo, Box<dyn Error>>
获取文件信息
Sourcepub async fn list_dir(
&self,
path_to_folder: &str,
params: Option<ListDirParams>,
) -> Result<ListDir, Box<dyn Error>>
pub async fn list_dir( &self, path_to_folder: &str, params: Option<ListDirParams>, ) -> Result<ListDir, Box<dyn Error>>
获取目录文件列表
Sourcepub async fn copy_file(
&self,
save_as_file: &str,
params: CopyParams,
) -> Result<(), Box<dyn Error>>
pub async fn copy_file( &self, save_as_file: &str, params: CopyParams, ) -> Result<(), Box<dyn Error>>
复制文件
同一个 bucket
下复制文件。并且它只能操作文件,不能操作文件夹。
Auto Trait Implementations§
impl Freeze for UpYun
impl !RefUnwindSafe for UpYun
impl Send for UpYun
impl Sync for UpYun
impl Unpin for UpYun
impl !UnwindSafe for UpYun
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