Filter

Trait Filter 

Source
pub trait Filter {
    type Frame;

    // Required methods
    fn try_push(&mut self, frame: Self::Frame) -> Result<(), CodecError>;
    fn try_flush(&mut self) -> Result<(), CodecError>;
    fn take(&mut self) -> Result<Option<Self::Frame>, Error>;

    // Provided methods
    fn push(&mut self, frame: Self::Frame) -> Result<(), Error> { ... }
    fn flush(&mut self) -> Result<(), Error> { ... }
}
Expand description

A media filter.

§Common filter operation

  1. Push a frame to the filter.
  2. Take all frames from the filter until you get None.
  3. If there are more frames to be filtered, continue with 1.
  4. Flush the filter.
  5. Take all frames from the filter until you get None.

Required Associated Types§

Required Methods§

Source

fn try_push(&mut self, frame: Self::Frame) -> Result<(), CodecError>

Push a given frame to the filter.

Source

fn try_flush(&mut self) -> Result<(), CodecError>

Flush the filter.

Source

fn take(&mut self) -> Result<Option<Self::Frame>, Error>

Take the next frame from the filter.

Provided Methods§

Source

fn push(&mut self, frame: Self::Frame) -> Result<(), Error>

Push a given frame to the filter.

§Panics

The method panics if the operation is not expected (i.e. another operation needs to be done).

Source

fn flush(&mut self) -> Result<(), Error>

Flush the filter.

§Panics

The method panics if the operation is not expected (i.e. another operation needs to be done).

Implementors§