Skip to main content

InjectionStrategy

Trait InjectionStrategy 

Source
pub trait InjectionStrategy {
    // Required methods
    fn name(&self) -> &'static str;
    fn can_apply(&self, entry: &JournalEntry) -> bool;
    fn apply<R: Rng>(
        &self,
        entry: &mut JournalEntry,
        anomaly_type: &AnomalyType,
        rng: &mut R,
    ) -> InjectionResult;
}
Expand description

Base trait for injection strategies.

Required Methods§

Source

fn name(&self) -> &'static str

Name of the strategy.

Source

fn can_apply(&self, entry: &JournalEntry) -> bool

Whether this strategy can be applied to the given entry.

Source

fn apply<R: Rng>( &self, entry: &mut JournalEntry, anomaly_type: &AnomalyType, rng: &mut R, ) -> InjectionResult

Applies the strategy to modify an entry.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§