pub struct RuleProse {
pub severity_rationale: String,
pub likely_cause: Option<String>,
pub likely_cause_template: Option<String>,
pub likely_cause_template_with_field: Option<String>,
pub likely_cause_template_no_field: Option<String>,
pub hypotheses: Vec<String>,
pub unknowns: Vec<String>,
pub next_steps: Vec<String>,
pub escalation_note: String,
}Expand description
Per-rule prose entry.
likely_cause and the three likely_cause_template_* fields are all
Option; each rule arm uses exactly one of them depending on whether
it needs to interpolate a placeholder. The
every_rule_template_kind_matches_its_call_site test pins which
variant each rule is expected to populate.
Fields§
§severity_rationale: String§likely_cause: Option<String>§likely_cause_template: Option<String>§likely_cause_template_with_field: Option<String>§likely_cause_template_no_field: Option<String>§hypotheses: Vec<String>§unknowns: Vec<String>§next_steps: Vec<String>§escalation_note: StringImplementations§
Source§impl RuleProse
impl RuleProse
Sourcepub fn likely_cause_static(&self) -> &str
pub fn likely_cause_static(&self) -> &str
Static likely-cause text for rules that don’t interpolate fields.
Sourcepub fn likely_cause_with_host(&self, host: &str) -> String
pub fn likely_cause_with_host(&self, host: &str) -> String
Likely-cause text with {host} substituted.
Sourcepub fn likely_cause_with_peer(&self, peer: &str) -> String
pub fn likely_cause_with_peer(&self, peer: &str) -> String
Likely-cause text with {peer} substituted.
Sourcepub fn likely_cause_with_optional_field(&self, field: Option<&str>) -> String
pub fn likely_cause_with_optional_field(&self, field: Option<&str>) -> String
Likely-cause text for bad_payload-style rules where the validated
field may or may not be present. Picks the right template and
substitutes {field} when applicable.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RuleProse
impl<'de> Deserialize<'de> for RuleProse
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 RuleProse
impl RefUnwindSafe for RuleProse
impl Send for RuleProse
impl Sync for RuleProse
impl Unpin for RuleProse
impl UnsafeUnpin for RuleProse
impl UnwindSafe for RuleProse
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