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§
fn query(&self, id: TypeId) -> Option<Box<dyn Any>>
fn get_read_buf(&self) -> Option<BytesVec>
fn release_read_buf(&self, buf: BytesVec)
sourcefn process_read_buf(&self, io: &IoRef, n: usize) -> Result<(usize, usize)>
fn process_read_buf(&self, io: &IoRef, n: usize) -> Result<(usize, usize)>
Process read buffer
Returns tuple (total bytes, new bytes)
fn get_write_buf(&self) -> Option<BytesVec>
fn release_write_buf(&self, buf: BytesVec) -> Result<()>
sourcefn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<ReadStatus>
fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<ReadStatus>
Check readiness for read operations
sourcefn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<WriteStatus>
fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<WriteStatus>
Check readiness for write operations
sourcefn poll_shutdown(&self) -> Poll<Result<()>>
fn poll_shutdown(&self) -> Poll<Result<()>>
Gracefully shutdown filter