Trait cybergrape::component::Component

source ·
pub trait Component {
    type InData;
    type OutData;

    // Required methods
    fn name(&self) -> String;
    fn convert(&mut self, input: Self::InData) -> Self::OutData;
    fn finalize(&mut self) -> Result<(), ComponentError>;
}
Expand description

A stage in the CyberGrape pipeline, which performs a step of the data aggregation, binauralization, or music playback process. All structs that perform a processing step in the CyberGrape system must implement Component, so that they can be integrated into the pipeline.

Required Associated Types§

source

type InData

The type of data the component takes as input

source

type OutData

The type of data the component produces as output

Required Methods§

source

fn name(&self) -> String

Return the name of the component, for logging

source

fn convert(&mut self, input: Self::InData) -> Self::OutData

Converts an input of type A into an output of type B

source

fn finalize(&mut self) -> Result<(), ComponentError>

Cleans up at termination of pipeline

Implementors§