Trait ntex_io::Filter

source ·
pub trait Filter: 'static {
    fn query(&self, id: TypeId) -> Option<Box<dyn Any>>;
    fn get_read_buf(&self) -> Option<BytesVec>;
    fn release_read_buf(&self, buf: BytesVec);
    fn process_read_buf(&self, io: &IoRef, n: usize) -> Result<(usize, usize)>;
    fn get_write_buf(&self) -> Option<BytesVec>;
    fn release_write_buf(&self, buf: BytesVec) -> Result<()>;
    fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<ReadStatus>;
    fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<WriteStatus>;
    fn poll_shutdown(&self) -> Poll<Result<()>>;
}

Required Methods§

Process read buffer

Returns tuple (total bytes, new bytes)

Check readiness for read operations

Check readiness for write operations

Gracefully shutdown filter

Implementors§