Skip to main content

Filter

Trait Filter 

Source
pub trait Filter: 'static {
    // Required methods
    fn query(&self, id: TypeId) -> Option<Box<dyn Any>>;
    fn process_read_buf(&self, ctx: &mut FilterCtx<'_>) -> Result<()>;
    fn process_write_buf(&self, ctx: &mut FilterCtx<'_>) -> Result<()>;
    fn shutdown(&self, ctx: &mut 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>>

Accesses internal filter information.

Source

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

Processes incoming read-buffer data.

Source

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

Processes outgoing write-buffer data.

Source

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

Performs a graceful shutdown of the filter.

Source

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

Checks whether read operations may proceed.

Source

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

Checks whether write operations may proceed.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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,