pub struct ProtectionPolicy;Expand description
The strict, veto-based protection policy.
Implementations§
Source§impl ProtectionPolicy
impl ProtectionPolicy
Sourcepub fn evaluate(proposal: &ChangeProposal) -> ProtectionReport
pub fn evaluate(proposal: &ChangeProposal) -> ProtectionReport
Evaluates a proposal.
Known deprivation is checked first, followed by missing evidence, risk, and finally full acceptance.
Examples found in repository?
examples/review_change.rs (line 36)
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}Trait Implementations§
Source§impl Clone for ProtectionPolicy
impl Clone for ProtectionPolicy
impl Copy for ProtectionPolicy
Source§impl Debug for ProtectionPolicy
impl Debug for ProtectionPolicy
Source§impl Default for ProtectionPolicy
impl Default for ProtectionPolicy
impl Eq for ProtectionPolicy
Source§impl PartialEq for ProtectionPolicy
impl PartialEq for ProtectionPolicy
impl StructuralPartialEq for ProtectionPolicy
Auto Trait Implementations§
impl Freeze for ProtectionPolicy
impl RefUnwindSafe for ProtectionPolicy
impl Send for ProtectionPolicy
impl Sync for ProtectionPolicy
impl Unpin for ProtectionPolicy
impl UnsafeUnpin for ProtectionPolicy
impl UnwindSafe for ProtectionPolicy
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