pub struct Hooks { /* private fields */ }Expand description
Lifecycle hooks for the HTTP client.
Implementations§
Source§impl Hooks
impl Hooks
pub fn new() -> Hooks
pub fn on_request<F, Fut>(self, f: F) -> Hookswhere
F: Fn(RequestContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<RequestContext, Error>> + Send + 'static,
pub fn on_response<F, Fut>(self, f: F) -> Hooks
pub fn on_success<F, Fut>(self, f: F) -> Hooks
pub fn on_error<F, Fut>(self, f: F) -> Hooks
pub fn on_retry<F, Fut>(self, f: F) -> Hooks
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hooks
impl !RefUnwindSafe for Hooks
impl Send for Hooks
impl Sync for Hooks
impl Unpin for Hooks
impl UnsafeUnpin for Hooks
impl !UnwindSafe for Hooks
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