Trait qiniu_sdk::prelude::UploaderWithCallbacks
source · [−]pub trait UploaderWithCallbacks {
fn on_before_request<F>(&mut self, callback: F) -> &mut Self
where
F: 'static + Fn(&mut RequestBuilderParts<'_>) -> CallbackResult + Send + Sync;
fn on_upload_progress<F>(&mut self, callback: F) -> &mut Self
where
F: 'static + Fn(&UploadingProgressInfo) -> CallbackResult + Send + Sync;
fn on_response_ok<F>(&mut self, callback: F) -> &mut Self
where
F: 'static + Fn(&mut ResponseParts) -> CallbackResult + Send + Sync;
fn on_response_error<F>(&mut self, callback: F) -> &mut Self
where
F: 'static + Fn(&Error) -> CallbackResult + Send + Sync;
}
Expand description
上传回调函数提供者
Required methods
fn on_before_request<F>(&mut self, callback: F) -> &mut Self where
F: 'static + Fn(&mut RequestBuilderParts<'_>) -> CallbackResult + Send + Sync,
fn on_before_request<F>(&mut self, callback: F) -> &mut Self where
F: 'static + Fn(&mut RequestBuilderParts<'_>) -> CallbackResult + Send + Sync,
设置请求前的回调函数
fn on_upload_progress<F>(&mut self, callback: F) -> &mut Self where
F: 'static + Fn(&UploadingProgressInfo) -> CallbackResult + Send + Sync,
fn on_upload_progress<F>(&mut self, callback: F) -> &mut Self where
F: 'static + Fn(&UploadingProgressInfo) -> CallbackResult + Send + Sync,
设置上传进度回调函数
fn on_response_ok<F>(&mut self, callback: F) -> &mut Self where
F: 'static + Fn(&mut ResponseParts) -> CallbackResult + Send + Sync,
fn on_response_ok<F>(&mut self, callback: F) -> &mut Self where
F: 'static + Fn(&mut ResponseParts) -> CallbackResult + Send + Sync,
设置响应成功的回调函数
fn on_response_error<F>(&mut self, callback: F) -> &mut Self where
F: 'static + Fn(&Error) -> CallbackResult + Send + Sync,
fn on_response_error<F>(&mut self, callback: F) -> &mut Self where
F: 'static + Fn(&Error) -> CallbackResult + Send + Sync,
设置响应错误的回调函数