TransformingHandler

Struct TransformingHandler 

Source
pub struct TransformingHandler<T, H, TI, HI>
where T: Transformer<TI, HI>, H: Handler<HI>,
{ /* private fields */ }
Expand description

Combines a transformer and a handler to create a new handler which conforms to the transformer’s input, but forwards its output to the handler.

Implementations§

Source§

impl<T, H, TI, HI> TransformingHandler<T, H, TI, HI>
where T: Transformer<TI, HI>, H: Handler<HI>,

Source

pub fn new(transformer: T, handler: H) -> Self

Creates a new TransformingHandler which transforms its input and forwards the result to the given handler.

Trait Implementations§

Source§

impl<T, H, TI, HI> From<(T, H)> for TransformingHandler<T, H, TI, HI>
where T: Transformer<TI, HI>, H: Handler<HI>,

Source§

fn from(value: (T, H)) -> Self

Converts to this type from the input type.
Source§

impl<T, H, TI, HI> Handler<TI> for TransformingHandler<T, H, TI, HI>
where T: Transformer<TI, HI>, H: Handler<HI>,

Source§

fn handle(&self, message: &TI)

Receives a borrowed value.

Auto Trait Implementations§

§

impl<T, H, TI, HI> Freeze for TransformingHandler<T, H, TI, HI>
where T: Freeze, H: Freeze,

§

impl<T, H, TI, HI> RefUnwindSafe for TransformingHandler<T, H, TI, HI>

§

impl<T, H, TI, HI> Send for TransformingHandler<T, H, TI, HI>
where T: Send, H: Send, TI: Send, HI: Send,

§

impl<T, H, TI, HI> Sync for TransformingHandler<T, H, TI, HI>
where T: Sync, H: Sync, TI: Sync, HI: Sync,

§

impl<T, H, TI, HI> Unpin for TransformingHandler<T, H, TI, HI>
where T: Unpin, H: Unpin, TI: Unpin, HI: Unpin,

§

impl<T, H, TI, HI> UnwindSafe for TransformingHandler<T, H, TI, HI>
where T: UnwindSafe, H: UnwindSafe, TI: UnwindSafe, HI: UnwindSafe,

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<H, M> IntoSubscriber<H, M> for H
where H: Handler<M>,

Source§

fn into_subscriber(self) -> SubscribingHandler<H, M>

Wraps the Handler in a SubscribingHandler, for use as a Subscriber.
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.