Trait Filter

Source
pub trait Filter: 'static {
    // Required methods
    fn query(&self, id: TypeId) -> Option<Box<dyn Any>>;
    fn process_read_buf(
        &self,
        ctx: FilterCtx<'_>,
        nbytes: usize,
    ) -> Result<FilterReadStatus>;
    fn process_write_buf(&self, ctx: FilterCtx<'_>) -> Result<()>;
    fn shutdown(&self, ctx: FilterCtx<'_>) -> Result<Poll<()>>;
    fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<Readiness>;
    fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<Readiness>;
}

Required Methods§

Source

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

Source

fn process_read_buf( &self, ctx: FilterCtx<'_>, nbytes: usize, ) -> Result<FilterReadStatus>

Source

fn process_write_buf(&self, ctx: FilterCtx<'_>) -> Result<()>

Process write buffer

Source

fn shutdown(&self, ctx: FilterCtx<'_>) -> Result<Poll<()>>

Gracefully shutdown filter

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

Implementors§

Source§

impl Filter for Base

Source§

impl Filter for Sealed

Source§

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