Trait FilterLayer

Source
pub trait FilterLayer: Debug + 'static {
    // Required methods
    fn process_read_buf(&self, buf: &ReadBuf<'_>) -> IoResult<usize>;
    fn process_write_buf(&self, buf: &WriteBuf<'_>) -> IoResult<()>;

    // Provided methods
    fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<Readiness> { ... }
    fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<Readiness> { ... }
    fn query(&self, id: TypeId) -> Option<Box<dyn Any>> { ... }
    fn shutdown(&self, buf: &WriteBuf<'_>) -> IoResult<Poll<()>> { ... }
}

Required Methods§

Source

fn process_read_buf(&self, buf: &ReadBuf<'_>) -> IoResult<usize>

Process read buffer

Inner filter must process buffer before current. Returns number of new bytes.

Source

fn process_write_buf(&self, buf: &WriteBuf<'_>) -> IoResult<()>

Process write buffer

Provided Methods§

Source

fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<Readiness>

Check readiness for read operations

Source

fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<Readiness>

Check readiness for write operations

Source

fn query(&self, id: TypeId) -> Option<Box<dyn Any>>

Query internal filter data

Source

fn shutdown(&self, buf: &WriteBuf<'_>) -> IoResult<Poll<()>>

Gracefully shutdown filter

Implementors§