Skip to main content

ChainedHandler

Struct ChainedHandler 

Source
pub struct ChainedHandler<H: Handler, D: Handler> { /* private fields */ }
Expand description

A handler which chains two handlers. Chaining mulltiple such handlers will generate a complex chain of handlers used to preproces/write/postprocess a record.

Implementations§

Source§

impl<H: Handler, D: Handler> ChainedHandler<H, D>

Links to handlers together Return a handler which first will compose the given handlers

§Arguments
  • handler - The bottom handler the one will be wrapped
  • decorator - The top handler the one will decorate the bottom one

Trait Implementations§

Source§

impl<H: Handler, D: Handler> Handler for ChainedHandler<H, D>

Source§

fn handle(&mut self, d: &impl Encodable, w: &mut impl Write) -> Result<usize>

Action to be done by this handler. By default this method will chain the incoming and the outgoing methods. Complex handlers may override this method to chain multiple handlers together. Read more
Source§

fn incoming( &mut self, _data: &impl Encodable, _write: &mut impl Write, ) -> Result<usize, Error>

Action to be done before a record is pushed into channel. Most common handlers will override this method, in order to add some header to a given record, or to transform a record before is written into the channel. Read more
Source§

fn outgoing( &mut self, _data: &impl Encodable, _write: &mut impl Write, ) -> Result<usize, Error>

Action to be done after a record is pushed into channel. Read more

Auto Trait Implementations§

§

impl<H, D> Freeze for ChainedHandler<H, D>
where Box<D>: Freeze, Box<H>: Freeze,

§

impl<H, D> RefUnwindSafe for ChainedHandler<H, D>

§

impl<H, D> Send for ChainedHandler<H, D>
where Box<D>: Send, Box<H>: Send,

§

impl<H, D> Sync for ChainedHandler<H, D>
where Box<D>: Sync, Box<H>: Sync,

§

impl<H, D> Unpin for ChainedHandler<H, D>
where Box<D>: Unpin, Box<H>: Unpin,

§

impl<H, D> UnsafeUnpin for ChainedHandler<H, D>
where Box<D>: UnsafeUnpin, Box<H>: UnsafeUnpin,

§

impl<H, D> UnwindSafe for ChainedHandler<H, D>
where Box<D>: UnwindSafe, Box<H>: 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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.