Skip to main content

Ctx

Struct Ctx 

Source
pub struct Ctx<'a> {
    pub session: &'a str,
    pub check: &'a str,
    pub channel: &'static str,
    pub lessons: &'a Path,
    pub summary: &'a Summary,
    pub tokens: u32,
    pub had: &'a [String],
    pub alpha: f64,
}
Expand description

The check a decision is made for.

Fields§

§session: &'a str§check: &'a str

The check’s id (check_id).

§channel: &'static str

stop or live.

§lessons: &'a Path

The lessons file the conscience reads (hook.rs lessons_path): the store whose outcomes count.

§summary: &'a Summary

The selection summary loaded beside lessons (select/summary.rs load).

§tokens: u32

The check’s pool tokens (shown_tokens, the graded record’s tokens); 0 unknown, the baseline’s. The fit and the gate’s ledger value the check at the logged tokens, so the learned policy decides at them too: the gain the gate admits is then the gain its ledger records.

§had: &'a [String]

The lessons this session already had delivered (asked, delivered early or handed over free: hook.rs had_in over the state read at the decision, decide) or has waiting in its queue to be asked or handed over by another check (hook.rs waiting_in), in any order. Such a lesson may still be asked, but never takes a free slot (the delivery would drop it as given before or queued twice, conscience.rs graded_without), and is never a placebo (draw_placebo). Only those among the applies count (nofree, what the graded record logs), so a replay passes the record’s nofree; empty for a record from before it, whose hook decided without.

§alpha: f64

The collective’s tolerance in force at the check (alpha: its risk in collectives.json, else policy::ALPHA), read once by the hook and logged on the graded record (Log::alpha), so a replay decides under the α the hook had (alpha_of the record’s), not whatever the config says for the replayed path now (a store copy maps to no collective).

Auto Trait Implementations§

§

impl<'a> Freeze for Ctx<'a>

§

impl<'a> RefUnwindSafe for Ctx<'a>

§

impl<'a> Send for Ctx<'a>

§

impl<'a> Sync for Ctx<'a>

§

impl<'a> Unpin for Ctx<'a>

§

impl<'a> UnsafeUnpin for Ctx<'a>

§

impl<'a> UnwindSafe for Ctx<'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.