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>
impl<H: Handler, D: Handler> ChainedHandler<H, D>
Sourcepub fn link(handler: H, decorator: D) -> ChainedHandler<H, D>
pub fn link(handler: H, decorator: D) -> 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 wrappeddecorator- The top handler the one will decorate the bottom one
Trait Implementations§
Source§impl<H: Handler, D: Handler> Handler for ChainedHandler<H, D>
impl<H: Handler, D: Handler> Handler for ChainedHandler<H, D>
Source§fn handle(&mut self, d: &impl Encodable, w: &mut impl Write) -> Result<usize>
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 moreSource§fn incoming(
&mut self,
_data: &impl Encodable,
_write: &mut impl Write,
) -> Result<usize, Error>
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
Auto Trait Implementations§
impl<H, D> Freeze for ChainedHandler<H, D>
impl<H, D> RefUnwindSafe for ChainedHandler<H, D>
impl<H, D> Send for ChainedHandler<H, D>
impl<H, D> Sync for ChainedHandler<H, D>
impl<H, D> Unpin for ChainedHandler<H, D>
impl<H, D> UnsafeUnpin for ChainedHandler<H, D>
impl<H, D> UnwindSafe for ChainedHandler<H, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more