pub struct RequestInfo<O> {
pub url: String,
pub method: Method,
pub headers: HashMap<String, String>,
pub body: RequestBody,
pub success_codes: Vec<u16>,
pub additional_retry_codes: Vec<u16>,
pub timeout: Duration,
pub query_params: HashMap<String, String>,
pub response_handler: ResponseHandler<O>,
pub error_handler: Option<Arc<dyn Fn(ResponsePayload, StorageError) -> StorageError + Send + Sync>>,
}Fields§
§url: String§method: Method§headers: HashMap<String, String>§body: RequestBody§success_codes: Vec<u16>§additional_retry_codes: Vec<u16>§timeout: Duration§query_params: HashMap<String, String>§response_handler: ResponseHandler<O>§error_handler: Option<Arc<dyn Fn(ResponsePayload, StorageError) -> StorageError + Send + Sync>>Implementations§
Source§impl<O> RequestInfo<O>
impl<O> RequestInfo<O>
pub fn new( url: impl Into<String>, method: Method, timeout: Duration, response_handler: ResponseHandler<O>, ) -> Self
pub fn with_body(self, body: RequestBody) -> Self
pub fn with_headers(self, headers: HashMap<String, String>) -> Self
pub fn with_query_param( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
pub fn with_success_codes(self, codes: Vec<u16>) -> Self
pub fn with_additional_retry_codes(self, codes: Vec<u16>) -> Self
pub fn with_error_handler( self, handler: Arc<dyn Fn(ResponsePayload, StorageError) -> StorageError + Send + Sync>, ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<O> Freeze for RequestInfo<O>
impl<O> !RefUnwindSafe for RequestInfo<O>
impl<O> Send for RequestInfo<O>
impl<O> Sync for RequestInfo<O>
impl<O> Unpin for RequestInfo<O>
impl<O> !UnwindSafe for RequestInfo<O>
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