pub struct ResponseSupportViolation {
pub family_label: &'static str,
pub requirement: &'static str,
pub offending: Vec<(usize, f64)>,
pub total_violations: usize,
}Expand description
Domain-violation detail produced by ResponseFamily::validate_response_support.
Owns its own Display impl so call sites in the workflow, the CLI, and the
external-design GLM path produce identical user-facing prose. The
total_violations counter is kept distinct from offending.len() so the
message can honestly say (N total) even when only the first
MAX_REPORTED indices are surfaced.
Fields§
§family_label: &'static str§requirement: &'static str§offending: Vec<(usize, f64)>§total_violations: usizeImplementations§
Source§impl ResponseSupportViolation
impl ResponseSupportViolation
Sourcepub const MAX_REPORTED: usize = 5
pub const MAX_REPORTED: usize = 5
Maximum number of offending row indices reported in the error message. Keeps the message bounded on large-scale data while still pointing the user at concrete bad rows to inspect.
Sourcepub fn message_for(&self, response_name: &str) -> String
pub fn message_for(&self, response_name: &str) -> String
Format the violation against a specific response column name. The
column name is supplied by the caller because ResponseFamily does
not know which column the user pointed at.
Trait Implementations§
Source§impl Clone for ResponseSupportViolation
impl Clone for ResponseSupportViolation
Source§fn clone(&self) -> ResponseSupportViolation
fn clone(&self) -> ResponseSupportViolation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResponseSupportViolation
impl Debug for ResponseSupportViolation
Source§impl Display for ResponseSupportViolation
impl Display for ResponseSupportViolation
Source§impl Error for ResponseSupportViolation
impl Error for ResponseSupportViolation
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()