pub struct Decision {
pub policy: ReviewPolicy,
pub findings: Vec<Finding>,
}Expand description
A policy and the findings that argued for it.
Fields§
§policy: ReviewPolicy§findings: Vec<Finding>Implementations§
Source§impl Decision
impl Decision
Sourcepub fn from_cove(value: &Value) -> Result<Decision, String>
pub fn from_cove(value: &Value) -> Result<Decision, String>
Reads a decision out of what an invocation answered.
The entry is declared Result<Decision, Error>, so what arrives is a
Result enum whose Ok payload is a rules.policy.Decision struct.
Every step names what it expected, because a decoder that answers
None tells its caller that something was wrong and not what.
This walk is the outbound half of what the measurement attributes to conversion. It is deliberately written the obvious way — ask for the case, read the field by name, clone the string — rather than the fast way, since what an embedder writes is what an embedder’s cost is.
It asks through the readers on Value and matches on none of its
variants, which is what issue #186 added them for: the shapes below
are the ones a rules.policy declaration states, and nothing here
says how the runtime holds one.
Sourcepub fn of(decision: &Value) -> Result<Decision, String>
pub fn of(decision: &Value) -> Result<Decision, String>
Reads a decision out of a bare rules.policy.Decision.
rules.embedded.evaluate is declared -> Decision rather than -> Result<Decision, Error>, because nothing it does can fail: it takes
the pull request as an argument instead of fetching it, and fetching
it was the only fallible step. So the answer arrives unwrapped, and
Decision::from_cove is this with the Result peeled off first.
Trait Implementations§
impl Eq for Decision
impl StructuralPartialEq for Decision
Auto Trait Implementations§
impl Freeze for Decision
impl RefUnwindSafe for Decision
impl Send for Decision
impl Sync for Decision
impl Unpin for Decision
impl UnsafeUnpin for Decision
impl UnwindSafe for Decision
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.