Skip to main content

InjectionStrategy

Enum InjectionStrategy 

Source
pub enum InjectionStrategy {
Show 14 variants AmountManipulation { original: Decimal, factor: f64, }, ThresholdAvoidance { threshold: Decimal, adjusted_amount: Decimal, }, DateShift { days_shifted: i32, original_date: NaiveDate, }, SelfApproval { user_id: String, }, SoDViolation { duty1: String, duty2: String, violating_user: String, }, ExactDuplicate { original_doc_id: String, }, NearDuplicate { original_doc_id: String, varied_fields: Vec<String>, }, CircularFlow { entity_chain: Vec<String>, }, SplitTransaction { original_amount: Decimal, split_count: u32, split_doc_ids: Vec<String>, }, RoundNumbering { original_amount: Decimal, rounded_amount: Decimal, }, TimingManipulation { timing_type: String, original_time: Option<NaiveDateTime>, }, AccountMisclassification { correct_account: String, incorrect_account: String, }, MissingField { field_name: String, }, Custom { name: String, parameters: HashMap<String, String>, },
}
Expand description

Structured injection strategy with captured parameters.

Unlike the string-based injection_strategy field, this enum captures the exact parameters used during injection for full reproducibility.

Variants§

§

AmountManipulation

Amount was manipulated by a factor.

Fields

§original: Decimal

Original amount before manipulation.

§factor: f64

Multiplication factor applied.

§

ThresholdAvoidance

Amount adjusted to avoid a threshold.

Fields

§threshold: Decimal

Threshold being avoided.

§adjusted_amount: Decimal

Final amount after adjustment.

§

DateShift

Date was backdated or forward-dated.

Fields

§days_shifted: i32

Number of days shifted (negative = backdated).

§original_date: NaiveDate

Original date before shift.

§

SelfApproval

User approved their own transaction.

Fields

§user_id: String

User who created and approved.

§

SoDViolation

Segregation of duties violation.

Fields

§duty1: String

First duty involved.

§duty2: String

Second duty involved.

§violating_user: String

User who performed both duties.

§

ExactDuplicate

Exact duplicate of another document.

Fields

§original_doc_id: String

ID of the original document.

§

NearDuplicate

Near-duplicate with small variations.

Fields

§original_doc_id: String

ID of the original document.

§varied_fields: Vec<String>

Fields that were varied.

§

CircularFlow

Circular flow of funds/goods.

Fields

§entity_chain: Vec<String>

Chain of entities involved.

§

SplitTransaction

Split transaction to avoid threshold.

Fields

§original_amount: Decimal

Original total amount.

§split_count: u32

Number of splits.

§split_doc_ids: Vec<String>

IDs of the split documents.

§

RoundNumbering

Round number manipulation.

Fields

§original_amount: Decimal

Original precise amount.

§rounded_amount: Decimal

Rounded amount.

§

TimingManipulation

Timing manipulation (weekend, after-hours, etc.).

Fields

§timing_type: String

Type of timing issue.

§original_time: Option<NaiveDateTime>

Original timestamp.

§

AccountMisclassification

Account misclassification.

Fields

§correct_account: String

Correct account.

§incorrect_account: String

Incorrect account used.

§

MissingField

Missing required field.

Fields

§field_name: String

Name of the missing field.

§

Custom

Custom injection strategy.

Fields

§name: String

Strategy name.

§parameters: HashMap<String, String>

Additional parameters.

Implementations§

Source§

impl InjectionStrategy

Source

pub fn description(&self) -> String

Returns a human-readable description of the strategy.

Source

pub fn strategy_type(&self) -> &'static str

Returns the strategy type name.

Trait Implementations§

Source§

impl Clone for InjectionStrategy

Source§

fn clone(&self) -> InjectionStrategy

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InjectionStrategy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for InjectionStrategy

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for InjectionStrategy

Source§

fn eq(&self, other: &InjectionStrategy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for InjectionStrategy

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for InjectionStrategy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,