pub trait FeatureExtractor<const N: usize> {
type Input;
// Required methods
fn schema(&self) -> &FeatureSchema<N>;
fn extract(
&mut self,
input: Self::Input,
writer: &mut FeatureVectorWriter<N>,
) -> Result<FeatureVector<N>, AnalyticsError>;
}Expand description
Feature extractor contract.
Required Associated Types§
Required Methods§
Sourcefn schema(&self) -> &FeatureSchema<N>
fn schema(&self) -> &FeatureSchema<N>
Returns extractor schema.
Sourcefn extract(
&mut self,
input: Self::Input,
writer: &mut FeatureVectorWriter<N>,
) -> Result<FeatureVector<N>, AnalyticsError>
fn extract( &mut self, input: Self::Input, writer: &mut FeatureVectorWriter<N>, ) -> Result<FeatureVector<N>, AnalyticsError>
Extracts a feature vector into a caller-owned writer.
§Errors
Returns AnalyticsError when the input cannot be converted into a
valid vector.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".