pub struct ProtectionReport { /* private fields */ }Expand description
An explainable policy result with stable principle ordering.
Implementations§
Source§impl ProtectionReport
impl ProtectionReport
Sourcepub const fn decision(&self) -> ProtectionDecision
pub const fn decision(&self) -> ProtectionDecision
Returns the final decision.
Examples found in repository?
examples/review_change.rs (line 38)
3fn main() -> Result<(), nitijo_save::ProtectionError> {
4 let proposal = ChangeProposal::new("Neighborhood service move")?
5 .assess(
6 P::InformedConsent,
7 Finding::Protected,
8 "Residents approved the plan",
9 )?
10 .assess(
11 P::MeaningfulChoice,
12 Finding::Protected,
13 "Existing service remains available",
14 )?
15 .assess(
16 P::RoutineContinuity,
17 Finding::AtRisk,
18 "Opening hours may change",
19 )?
20 .assess(
21 P::EssentialAccess,
22 Finding::Protected,
23 "Step-free route verified",
24 )?
25 .assess(
26 P::Reversibility,
27 Finding::Protected,
28 "Three-month rollback window",
29 )?
30 .assess(
31 P::ProportionateBurden,
32 Finding::Protected,
33 "No added fee or travel time",
34 )?;
35
36 let report = ProtectionPolicy::evaluate(&proposal);
37 println!("proposal: {}", proposal.name());
38 println!("decision: {:?}", report.decision());
39 println!("at risk: {:?}", report.at_risk());
40
41 Ok(())
42}Sourcepub fn missing(&self) -> &[EverydayPrinciple]
pub fn missing(&self) -> &[EverydayPrinciple]
Returns principles without an assessment.
Sourcepub fn at_risk(&self) -> &[EverydayPrinciple]
pub fn at_risk(&self) -> &[EverydayPrinciple]
Returns principles that need mitigation.
Examples found in repository?
examples/review_change.rs (line 39)
3fn main() -> Result<(), nitijo_save::ProtectionError> {
4 let proposal = ChangeProposal::new("Neighborhood service move")?
5 .assess(
6 P::InformedConsent,
7 Finding::Protected,
8 "Residents approved the plan",
9 )?
10 .assess(
11 P::MeaningfulChoice,
12 Finding::Protected,
13 "Existing service remains available",
14 )?
15 .assess(
16 P::RoutineContinuity,
17 Finding::AtRisk,
18 "Opening hours may change",
19 )?
20 .assess(
21 P::EssentialAccess,
22 Finding::Protected,
23 "Step-free route verified",
24 )?
25 .assess(
26 P::Reversibility,
27 Finding::Protected,
28 "Three-month rollback window",
29 )?
30 .assess(
31 P::ProportionateBurden,
32 Finding::Protected,
33 "No added fee or travel time",
34 )?;
35
36 let report = ProtectionPolicy::evaluate(&proposal);
37 println!("proposal: {}", proposal.name());
38 println!("decision: {:?}", report.decision());
39 println!("at risk: {:?}", report.at_risk());
40
41 Ok(())
42}Sourcepub fn deprivations(&self) -> &[EverydayPrinciple]
pub fn deprivations(&self) -> &[EverydayPrinciple]
Returns principles containing known deprivation.
Trait Implementations§
Source§impl Clone for ProtectionReport
impl Clone for ProtectionReport
Source§impl Debug for ProtectionReport
impl Debug for ProtectionReport
impl Eq for ProtectionReport
Source§impl PartialEq for ProtectionReport
impl PartialEq for ProtectionReport
impl StructuralPartialEq for ProtectionReport
Auto Trait Implementations§
impl Freeze for ProtectionReport
impl RefUnwindSafe for ProtectionReport
impl Send for ProtectionReport
impl Sync for ProtectionReport
impl Unpin for ProtectionReport
impl UnsafeUnpin for ProtectionReport
impl UnwindSafe for ProtectionReport
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