pub struct Uploader { /* private fields */ }Expand description
Manage all uploading information; handle uplaoding and resuming. However, this struct does not include a copy of raw file or chunks. They shoud be either borrowed from the current transaction or import from a file path (such as resuming).
Implementations§
Source§impl Uploader
impl Uploader
Sourcepub fn uploader_json(&self) -> String
pub fn uploader_json(&self) -> String
Save the uploader information as a json string. The saved data can be later used for resuming the uploading.
Sourcepub fn resume(uploader_json: &str) -> Self
pub fn resume(uploader_json: &str) -> Self
Resume an uploading by input a saved uploader json information.
pub fn current_idx(&self) -> usize
pub fn chunk_size(&self) -> usize
pub fn verify_uploader(&self, chunks: &Chunks) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Uploader
impl<'de> Deserialize<'de> for Uploader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Uploader
impl RefUnwindSafe for Uploader
impl Send for Uploader
impl Sync for Uploader
impl Unpin for Uploader
impl UnwindSafe for Uploader
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