pub struct Assessment { /* private fields */ }Expand description
A COMPLETED assessment of a coordinate. A Block is a normal Assessment
value — never an error. “Couldn’t get a verdict” is the Err arm of the
acquisition Result, kept strictly distinct from any Assessment.
Implementations§
Source§impl Assessment
impl Assessment
Sourcepub fn new(state: CustomerState) -> Self
pub fn new(state: CustomerState) -> Self
Wrap an already-derived CustomerState.
Sourcepub fn from_wire(source: &str) -> Self
pub fn from_wire(source: &str) -> Self
Derive from the wire source (see CustomerState::from_wire).
Sourcepub fn from_wire_with_source_state(
source: &str,
source_state: Option<&str>,
) -> Self
pub fn from_wire_with_source_state( source: &str, source_state: Option<&str>, ) -> Self
Derive taking the envelope-v2 source_state into account
(see CustomerState::from_wire_with_source_state).
Sourcepub fn from_wire_with_source_state_and_origin(
source: &str,
source_state: Option<&str>,
matched_rule_id: Option<&str>,
) -> Self
pub fn from_wire_with_source_state_and_origin( source: &str, source_state: Option<&str>, matched_rule_id: Option<&str>, ) -> Self
CLEANLIB-855: same as [from_wire_with_source_state], plus resolves
Compromised when matched_rule_id names a curated
supply-chain-compromise-bridge rule (see
CustomerState::from_wire_with_source_state_and_origin).
Sourcepub fn state(&self) -> CustomerState
pub fn state(&self) -> CustomerState
The underlying customer state.
Sourcepub fn is_allowed(&self) -> bool
pub fn is_allowed(&self) -> bool
Clean-to-proceed? true only for the Clean tier. Fail-closed: a Warn
(including NotYetAssessed / RangeNotResolved) is NOT allowed. This is
the single predicate enforce gates on, so the “only Clean proceeds”
invariant lives in exactly one place.
Sourcepub fn enforce(&self) -> Result<(), GateError>
pub fn enforce(&self) -> Result<(), GateError>
enforce as a method on an already-obtained assessment: Ok(()) iff
clean-to-proceed, else GateError::Blocked. (The free enforce
function additionally folds a couldn’t-assess Err into
GateError::NotAssessed.)
Trait Implementations§
Source§impl Clone for Assessment
impl Clone for Assessment
Source§fn clone(&self) -> Assessment
fn clone(&self) -> Assessment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more