pub struct ReductionContext {
pub views: IndexMap<CaseKey, ErasedWorkflowView>,
pub active_interactions: Vec<ActiveInteractionSummary>,
pub target_map: TargetTokenMap,
pub operations: OperationCatalog,
pub policy: PolicySnapshot,
pub limits: PlanLimits,
pub now: DateTime<Utc>,
pub confirm_every_write: BTreeSet<CaseKey>,
pub subject_only_when_named: BTreeSet<CaseKey>,
}Expand description
Everything the reducer sees besides the plan and the turn.
Fields§
§views: IndexMap<CaseKey, ErasedWorkflowView>Projected views of every loaded case.
active_interactions: Vec<ActiveInteractionSummary>Active interactions in the conversation.
target_map: TargetTokenMapTokens issued for this turn.
operations: OperationCatalogOperations offered for this turn.
policy: PolicySnapshotPolicy configuration.
limits: PlanLimitsPlan limits.
now: DateTime<Utc>The clock value the reducer must use (it must not read the clock).
confirm_every_write: BTreeSet<CaseKey>The cases every write on which has to pass through a click.
Set by the application, per case, through its case directory. A command
on one of these that would otherwise have run silently gets the
confirmation raised instead, on a card that names the case — the same
thing ConstraintKind::AskBeforeApplying does when a user asks for it. Empty is the ordinary case and changes
nothing.
subject_only_when_named: BTreeSet<CaseKey>The cases that are in view only because the actor may reach them.
Set by the application, per case, through its case directory: a record another conversation is filling in, one left open in a thread that no longer exists, anything the turn has in view because it is reachable rather than because this turn is about it.
What it does is keep such a case from acting as a subject on its own. It is not hidden and not unreachable — it stays in the catalog under its own names, and the moment an act of this turn lands on it it is a subject like any other, which is the only way a draft left in a deleted conversation can ever be finished. What it stops is the three things a case does merely by being in the room: holding the door against a second case beside it, briefing the writer in the imperative, and putting its own outstanding fields in front of a reader answering about something else.
Empty is the ordinary case and changes nothing.
Implementations§
Source§impl ReductionContext
impl ReductionContext
Sourcepub fn view_for(&self, key: &CaseKey) -> Option<&ErasedWorkflowView>
pub fn view_for(&self, key: &CaseKey) -> Option<&ErasedWorkflowView>
View of a case, if loaded.
Sourcepub fn confirms_every_write(&self, key: &CaseKey) -> bool
pub fn confirms_every_write(&self, key: &CaseKey) -> bool
Whether every write on key has to pass through a click.
Sourcepub fn is_subject_only_when_named(&self, key: &CaseKey) -> bool
pub fn is_subject_only_when_named(&self, key: &CaseKey) -> bool
Whether key is in view only because the actor may reach it, so it is
a subject of this turn only if the turn names it.
Sourcepub fn blocking_interaction_for(
&self,
key: &CaseKey,
) -> Option<&ActiveInteractionSummary>
pub fn blocking_interaction_for( &self, key: &CaseKey, ) -> Option<&ActiveInteractionSummary>
The active blocking interaction of a case, if any.
Trait Implementations§
Source§impl Clone for ReductionContext
impl Clone for ReductionContext
Source§fn clone(&self) -> ReductionContext
fn clone(&self) -> ReductionContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more