anterofit

Struct InterceptorMut

Source
pub struct InterceptorMut<'a>(/* private fields */);
Expand description

A mutator for modifying the Interceptor of an Adapter.

Implementations§

Source§

impl<'a> InterceptorMut<'a>

Source

pub fn remove(&mut self)

Remove the interceptor from the adapter.

Source

pub fn set<I>(&mut self, new: I)
where I: Interceptor,

Set a new interceptor, discarding the old one.

Source

pub fn chain_before<I>(&mut self, before: I)
where I: Interceptor,

Chain the given Interceptor before the one currently in the adapter.

Equivalent to set(before) if the adapter does not have an interceptor or was constructed with NoIntercept as the interceptor.

Source

pub fn chain_after<I>(&mut self, after: I)
where I: Interceptor,

Chain the given Interceptor after the one currently in the adapter.

Equivalent to set(after) if the adapter does not have an interceptor or was constructed with NoIntercept as the interceptor.

Source

pub fn chain_around<I1, I2>(&mut self, before: I1, after: I2)
where I1: Interceptor, I2: Interceptor,

Chain the given Interceptors before and after the one currently in the adapter.

This saves a level of boxing over calling chain_before() and chain_after() separately.

Equivalent to set(before.chain(after)) if the adapter does not have an interceptor or was constructed with NoIntercept as the interceptor.

Auto Trait Implementations§

§

impl<'a> Freeze for InterceptorMut<'a>

§

impl<'a> !RefUnwindSafe for InterceptorMut<'a>

§

impl<'a> Send for InterceptorMut<'a>

§

impl<'a> Sync for InterceptorMut<'a>

§

impl<'a> Unpin for InterceptorMut<'a>

§

impl<'a> !UnwindSafe for InterceptorMut<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Typeable for T
where T: Any,

Source§

fn get_type(&self) -> TypeId

Get the TypeId of this object.
Source§

impl<T> Erased for T