Trait anterofit::net::intercept::Interceptor[][src]

pub trait Interceptor: Send + Sync + 'static {
    fn intercept(&self, req: &mut RequestHead);

    fn chain<I>(self, then: I) -> Chain<Self, I>
    where
        Self: Sized,
        I: Interceptor
, { ... }
fn chain2<I1, I2>(self, then: I1, after: I2) -> Chain2<Self, I1, I2>
    where
        Self: Sized,
        I1: Interceptor,
        I2: Interceptor
, { ... }
fn debug(&self, f: &mut Formatter) -> Result { ... } }

A trait describing a type which may intercept and modify outgoing request from an adapter instance.

Implemented for Fn(&mut RequestHead) + Send + Sync + 'static.

Required Methods

Modify the request head in any way desired.

Great care must be taken to not introduce logic errors in service methods (i.e. by changing their endpoints such that they receive unexpected responses).

Provided Methods

Chain self with then, invoking self then then for each request.

Chain self with two more interceptors.

Saves a level in debug printing, mainly.

Write debug output equivalent to std::fmt::Debug.

Trait Implementations

impl Debug for Interceptor
[src]

Formats the value using the given formatter. Read more

Implementations on Foreign Types

impl<I: Interceptor + ?Sized> Interceptor for Arc<I>
[src]

Implementors