HttpRequestExt

Trait HttpRequestExt 

Source
pub trait HttpRequestExt {
    // Required method
    fn follow_redirects(self, follow: RedirectPolicy) -> Self;

    // Provided methods
    fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
       where Self: Sized { ... }
    fn when_some<T>(
        self,
        option: Option<T>,
        then: impl FnOnce(Self, T) -> Self,
    ) -> Self
       where Self: Sized { ... }
}

Required Methods§

Source

fn follow_redirects(self, follow: RedirectPolicy) -> Self

Whether or not to follow redirects

Provided Methods§

Source

fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
where Self: Sized,

Conditionally modify self with the given closure.

Source

fn when_some<T>( self, option: Option<T>, then: impl FnOnce(Self, T) -> Self, ) -> Self
where Self: Sized,

Conditionally unwrap and modify self with the given closure, if the given option is Some.

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.

Implementations on Foreign Types§

Source§

impl HttpRequestExt for Builder

Source§

fn follow_redirects(self, follow: RedirectPolicy) -> Self

Implementors§