Skip to main content

Folded

Struct Folded 

Source
pub struct Folded<'a> {
    pub clock: Clock,
    pub result: HashMap<&'a str, HashMap<&'a str, u8>>,
    pub uses: HashMap<&'a str, HashSet<&'a str>>,
    pub repos: HashMap<&'a str, HashSet<&'a str>>,
    pub regret: Vec<(&'a str, &'a str, f64)>,
    pub tested: HashMap<&'a str, HashSet<&'a str>>,
    pub corrections: HashMap<&'a str, HashSet<i64>>,
}
Expand description

What derive reads from the outcomes, before any lesson or session is applied. Every part is a max, a min or a union per key, so it is the same whatever the order of the lines and however often one repeats: facts.rs folds it incrementally and hands it over in this form.

Fields§

§clock: Clock§result: HashMap<&'a str, HashMap<&'a str, u8>>

Per (lesson, session): its result_of, the largest.

§uses: HashMap<&'a str, HashSet<&'a str>>

Per lesson: the sessions whose result was a change (a later correction in that session still deposited the change), and the repos of those changes.

§repos: HashMap<&'a str, HashSet<&'a str>>§regret: Vec<(&'a str, &'a str, f64)>

Per (lesson, deciding session): (lesson, session, the credit of the regrets that blame it, each regret once: blame). A regret’s credit is the largest of its duplicate lines (merging two logs merges memory), the session it blames the first line’s.

§tested: HashMap<&'a str, HashSet<&'a str>>

Per lesson: the sessions whose own tests went green after it was asked.

§corrections: HashMap<&'a str, HashSet<i64>>

Per session: the engineer’s corrections the log shows (regret_cap).

Implementations§

Source§

impl<'a> Folded<'a>

Source

pub fn of(outcomes: &'a [Outcome]) -> Self

Trait Implementations§

Source§

impl<'a> Debug for Folded<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for Folded<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Folded<'a>

§

impl<'a> RefUnwindSafe for Folded<'a>

§

impl<'a> Send for Folded<'a>

§

impl<'a> Sync for Folded<'a>

§

impl<'a> Unpin for Folded<'a>

§

impl<'a> UnsafeUnpin for Folded<'a>

§

impl<'a> UnwindSafe for Folded<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.