pub struct UploadPart { /* private fields */ }Expand description
Initialize a multipart upload part
See the Alibaba Cloud documentation for details
Implementations§
Source§impl UploadPart
impl UploadPart
Sourcepub fn set_callback(
self,
callback: Box<dyn Fn(u64, u64) + Send + Sync + 'static>,
) -> Self
pub fn set_callback( self, callback: Box<dyn Fn(u64, u64) + Send + Sync + 'static>, ) -> Self
Set a callback for upload progress; this only applies to send_file()
let callback = Box::new(|uploaded_size: u64, total_size: u64| {
let percentage = if total_size == 0 {
100.0
} else {
(uploaded_size as f64) / (total_size as f64) * 100.00
};
println!("{:.2}%", percentage);
});Auto Trait Implementations§
impl Freeze for UploadPart
impl !RefUnwindSafe for UploadPart
impl Send for UploadPart
impl Sync for UploadPart
impl Unpin for UploadPart
impl !UnwindSafe for UploadPart
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