pub enum PreprocessorImpl {
None,
Prefix {
prefix: String,
},
Template {
template: String,
},
}Expand description
Concrete preprocessor built from PreprocessorConfig.
Variants§
None
Pass text through unchanged.
Prefix
Prepend a fixed prefix.
Template
Substitute {{text}} into a template.
Implementations§
Source§impl PreprocessorImpl
impl PreprocessorImpl
Sourcepub fn from_config(config: &PreprocessorConfig) -> Self
pub fn from_config(config: &PreprocessorConfig) -> Self
Builds the concrete preprocessor for a config value.
Sourcepub fn preprocess(&self, text: &str) -> String
pub fn preprocess(&self, text: &str) -> String
Applies the preprocessing rule to a single text.
Sourcepub fn process_batch(&self, texts: &[&str]) -> Vec<String>
pub fn process_batch(&self, texts: &[&str]) -> Vec<String>
Applies the preprocessing rule to a batch of texts, preserving order.
Trait Implementations§
Source§impl Clone for PreprocessorImpl
impl Clone for PreprocessorImpl
Auto Trait Implementations§
impl Freeze for PreprocessorImpl
impl RefUnwindSafe for PreprocessorImpl
impl Send for PreprocessorImpl
impl Sync for PreprocessorImpl
impl Unpin for PreprocessorImpl
impl UnsafeUnpin for PreprocessorImpl
impl UnwindSafe for PreprocessorImpl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more