Skip to main content

StatefulTransform

Trait StatefulTransform 

Source
pub trait StatefulTransform: Send {
    // Required methods
    fn push(&mut self, sample: Sample) -> Vec<Sample>;
    fn finish(&mut self) -> Vec<Sample>;
    fn name(&self) -> &str;
}
Expand description

A stateful transform that can buffer, reorder, or group samples.

Unlike Transform, stateful transforms receive samples one at a time via push and yield zero or more samples via finish or internal buffering.

Required Methods§

Source

fn push(&mut self, sample: Sample) -> Vec<Sample>

Push a sample into this transform. Returns any immediately available outputs.

Source

fn finish(&mut self) -> Vec<Sample>

Signal that no more input is coming. Returns any buffered samples.

Source

fn name(&self) -> &str

Human-readable name for logging.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§