pub struct ResumableUploadManager { /* private fields */ }Expand description
断点续传管理器:持久化分片上传状态,支持中断后恢复
Implementations§
Source§impl ResumableUploadManager
impl ResumableUploadManager
pub fn new() -> Self
Sourcepub fn initiate(
&self,
key: &str,
content_type: &str,
total_size: usize,
part_size: usize,
) -> Result<String, StorageError>
pub fn initiate( &self, key: &str, content_type: &str, total_size: usize, part_size: usize, ) -> Result<String, StorageError>
发起分片上传
Sourcepub fn upload_part(
&self,
upload_id: &str,
number: u32,
data: Vec<u8>,
) -> Result<String, StorageError>
pub fn upload_part( &self, upload_id: &str, number: u32, data: Vec<u8>, ) -> Result<String, StorageError>
上传单个分片
Sourcepub fn get_session(&self, upload_id: &str) -> Option<MultipartUploadSnapshot>
pub fn get_session(&self, upload_id: &str) -> Option<MultipartUploadSnapshot>
获取上传会话状态(用于断点续传查询已上传分片)
Sourcepub fn list_uploads(&self) -> Vec<String>
pub fn list_uploads(&self) -> Vec<String>
列出所有活跃的上传会话 ID(不包含已完成或已中止的)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ResumableUploadManager
impl RefUnwindSafe for ResumableUploadManager
impl Send for ResumableUploadManager
impl Sync for ResumableUploadManager
impl Unpin for ResumableUploadManager
impl UnsafeUnpin for ResumableUploadManager
impl UnwindSafe for ResumableUploadManager
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