Trait UploaderWithCallbacks

Source
pub trait UploaderWithCallbacks {
    // Required methods
    fn on_before_request<F>(&mut self, callback: F) -> &mut Self
       where F: Fn(&mut RequestBuilderParts<'_>) -> Result<(), Error> + Send + Sync + 'static;
    fn on_upload_progress<F>(&mut self, callback: F) -> &mut Self
       where F: Fn(&UploadingProgressInfo) -> Result<(), Error> + Send + Sync + 'static;
    fn on_response_ok<F>(&mut self, callback: F) -> &mut Self
       where F: Fn(&mut ResponseParts) -> Result<(), Error> + Send + Sync + 'static;
    fn on_response_error<F>(&mut self, callback: F) -> &mut Self
       where F: Fn(&mut Error) -> Result<(), Error> + Send + Sync + 'static;
}
Expand description

上传回调函数提供者

Required Methods§

Source

fn on_before_request<F>(&mut self, callback: F) -> &mut Self
where F: Fn(&mut RequestBuilderParts<'_>) -> Result<(), Error> + Send + Sync + 'static,

设置请求前的回调函数

Source

fn on_upload_progress<F>(&mut self, callback: F) -> &mut Self
where F: Fn(&UploadingProgressInfo) -> Result<(), Error> + Send + Sync + 'static,

设置上传进度回调函数

Source

fn on_response_ok<F>(&mut self, callback: F) -> &mut Self
where F: Fn(&mut ResponseParts) -> Result<(), Error> + Send + Sync + 'static,

设置响应成功的回调函数

Source

fn on_response_error<F>(&mut self, callback: F) -> &mut Self
where F: Fn(&mut Error) -> Result<(), Error> + Send + Sync + 'static,

设置响应错误的回调函数

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§