Skip to main content

Mapper

Trait Mapper 

Source
pub trait Mapper: Send {
    // Required method
    fn map(&mut self, bytes: &[u8]) -> Bytes;
}
Expand description

Generic byte-stream transformation.

&mut self because some future mappers (e.g. one that normalises \r\n straddling a chunk boundary) will keep state across calls. The line-ending mapper is stateless but pays the same signature cost.

Required Methods§

Source

fn map(&mut self, bytes: &[u8]) -> Bytes

Transforms the input chunk and returns the result.

Implementors§