pub struct ValidationResult {
pub rule_id: String,
pub rule_name: String,
pub relationship_type: RelationshipType,
pub calculated_value: Decimal,
pub target_value: Option<Decimal>,
pub is_valid: bool,
pub deviation: Option<Decimal>,
pub deviation_percent: Option<Decimal>,
pub severity: RuleSeverity,
pub message: String,
}Expand description
Result of validating a balance relationship.
Fields§
§rule_id: StringRule that was validated.
rule_name: StringRule name.
relationship_type: RelationshipTypeRelationship type.
calculated_value: DecimalCalculated value.
target_value: Option<Decimal>Target value.
is_valid: boolIs the value within acceptable range?
deviation: Option<Decimal>Deviation from target.
deviation_percent: Option<Decimal>Deviation percentage.
severity: RuleSeveritySeverity.
message: StringValidation message.
Implementations§
Source§impl ValidationResult
impl ValidationResult
Sourcepub fn pass(rule: &BalanceRelationshipRule, calculated_value: Decimal) -> Self
pub fn pass(rule: &BalanceRelationshipRule, calculated_value: Decimal) -> Self
Create a passing result.
Sourcepub fn fail(
rule: &BalanceRelationshipRule,
calculated_value: Decimal,
message: String,
) -> Self
pub fn fail( rule: &BalanceRelationshipRule, calculated_value: Decimal, message: String, ) -> Self
Create a failing result.
Trait Implementations§
Source§impl Clone for ValidationResult
impl Clone for ValidationResult
Source§fn clone(&self) -> ValidationResult
fn clone(&self) -> ValidationResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidationResult
impl Debug for ValidationResult
Source§impl<'de> Deserialize<'de> for ValidationResult
impl<'de> Deserialize<'de> for ValidationResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ValidationResult
impl RefUnwindSafe for ValidationResult
impl Send for ValidationResult
impl Sync for ValidationResult
impl Unpin for ValidationResult
impl UnwindSafe for ValidationResult
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