Trait ntex_io::Filter

source ·
pub trait Filter: 'static {
    fn query(&self, id: TypeId) -> Option<Box<dyn Any>>;
    fn process_read_buf(
        &self,
        io: &IoRef,
        stack: &Stack,
        idx: usize,
        nbytes: usize
    ) -> Result<FilterReadStatus>; fn process_write_buf(
        &self,
        io: &IoRef,
        stack: &Stack,
        idx: usize
    ) -> Result<()>; fn shutdown(&self, io: &IoRef, stack: &Stack, idx: usize) -> Result<Poll<()>>; fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<ReadStatus>; fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<WriteStatus>; }

Required Methods§

source

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

source

fn process_read_buf(
    &self,
    io: &IoRef,
    stack: &Stack,
    idx: usize,
    nbytes: usize
) -> Result<FilterReadStatus>

source

fn process_write_buf(&self, io: &IoRef, stack: &Stack, idx: usize) -> Result<()>

Process write buffer

source

fn shutdown(&self, io: &IoRef, stack: &Stack, idx: usize) -> Result<Poll<()>>

Gracefully shutdown filter

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

Implementors§

source§

impl Filter for Base

source§

impl<F, L> Filter for Layer<F, L>where
    F: FilterLayer,
    L: Filter,