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§
Required Methods§
sourcefn convert(&mut self, input: Self::InData) -> Self::OutData
fn convert(&mut self, input: Self::InData) -> Self::OutData
Converts an input of type A into an output of type B
sourcefn finalize(&mut self) -> Result<(), ComponentError>
fn finalize(&mut self) -> Result<(), ComponentError>
Cleans up at termination of pipeline