ntex_io

Trait FilterLayer

source
pub trait FilterLayer: Debug + 'static {
    const BUFFERS: bool = true;

    // 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<ReadStatus> { ... }
    fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<WriteStatus> { ... }
    fn query(&self, id: TypeId) -> Option<Box<dyn Any>> { ... }
    fn shutdown(&self, buf: &WriteBuf<'_>) -> IoResult<Poll<()>> { ... }
}

Provided Associated Constants§

source

const BUFFERS: bool = true

Create buffers for this filter

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<ReadStatus>

Check readiness for read operations

source

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

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

Object Safety§

This trait is not object safe.

Implementors§