#[non_exhaustive]pub struct Explanation<A> {
pub id: A,
pub allowed: bool,
pub utility: Score,
pub contributions: Vec<Contribution>,
}Expand description
Why an action was chosen: its id, final utility, and the per-consideration breakdown (in declaration order) that produced it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: AThe chosen action’s id.
allowed: boolWhether the chosen action was permitted. false means every action was
gated off and this one won only by tie-break — its utility is zero.
utility: ScoreThe winning utility score.
contributions: Vec<Contribution>One entry per consideration, in declaration order.
Trait Implementations§
Source§impl<A: Clone> Clone for Explanation<A>
impl<A: Clone> Clone for Explanation<A>
Source§fn clone(&self) -> Explanation<A>
fn clone(&self) -> Explanation<A>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<A: Debug> Debug for Explanation<A>
impl<A: Debug> Debug for Explanation<A>
impl<A: Eq> Eq for Explanation<A>
Source§impl<A: PartialEq> PartialEq for Explanation<A>
impl<A: PartialEq> PartialEq for Explanation<A>
Source§fn eq(&self, other: &Explanation<A>) -> bool
fn eq(&self, other: &Explanation<A>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<A> StructuralPartialEq for Explanation<A>
Auto Trait Implementations§
impl<A> Freeze for Explanation<A>where
A: Freeze,
impl<A> RefUnwindSafe for Explanation<A>where
A: RefUnwindSafe,
impl<A> Send for Explanation<A>where
A: Send,
impl<A> Sync for Explanation<A>where
A: Sync,
impl<A> Unpin for Explanation<A>where
A: Unpin,
impl<A> UnsafeUnpin for Explanation<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for Explanation<A>where
A: UnwindSafe,
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