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§
Sourcefn can_apply(&self, entry: &JournalEntry) -> bool
fn can_apply(&self, entry: &JournalEntry) -> bool
Whether this strategy can be applied to the given entry.
Sourcefn apply<R: Rng>(
&self,
entry: &mut JournalEntry,
anomaly_type: &AnomalyType,
rng: &mut R,
) -> InjectionResult
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".