pub struct AppendObject { /* private fields */ }Expand description
Append to a file
Only files of type Appendable can be appended; files uploaded via the put method cannot be appended
The final size of the file after appending cannot exceed 5GB
The logic and limitations of append operations are complex; please read the Alibaba Cloud documentation
Implementations§
Source§impl AppendObject
impl AppendObject
Sourcepub fn set_position(self, position: u32) -> Self
pub fn set_position(self, position: u32) -> Self
Set the starting position for the appended content
Sourcepub fn set_mime(self, mime: impl ToString) -> Self
pub fn set_mime(self, mime: impl ToString) -> Self
Set the file’s MIME type
If no MIME type is set, the request will try to determine it from the content, local path, or remote path. If still unsuccessful, the default MIME type (application/octet-stream) is used
Sourcepub fn set_storage_class(self, storage_class: StorageClass) -> Self
pub fn set_storage_class(self, storage_class: StorageClass) -> Self
Set the file’s storage class
Sourcepub fn set_cache_control(self, cache_control: CacheControl) -> Self
pub fn set_cache_control(self, cache_control: CacheControl) -> Self
Cache behavior of the webpage when the file is downloaded
Sourcepub fn set_content_disposition(
self,
content_disposition: ContentDisposition,
) -> Self
pub fn set_content_disposition( self, content_disposition: ContentDisposition, ) -> Self
Set how the file is presented
Sourcepub fn set_meta(self, key: impl ToString, value: impl ToString) -> Self
pub fn set_meta(self, key: impl ToString, value: impl ToString) -> Self
Set additional metadata
Keys may only contain letters, numbers, and hyphens; metadata with other characters will be discarded
Sourcepub fn set_tagging(self, key: impl ToString, value: impl ToString) -> Self
pub fn set_tagging(self, key: impl ToString, value: impl ToString) -> Self
Set tag information
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);
});