pub struct TargetResolver { /* private fields */ }Expand description
Resolves the targets of one turn against the cases the actor may address.
Implementations§
Source§impl TargetResolver
impl TargetResolver
Sourcepub fn builder(account_id: AccountId, turn_id: TurnId) -> TargetResolverBuilder
pub fn builder(account_id: AccountId, turn_id: TurnId) -> TargetResolverBuilder
Starts a builder for account_id and turn_id.
Sourcepub fn admit(&mut self, candidate: AuthorizedCase) -> TargetToken
pub fn admit(&mut self, candidate: AuthorizedCase) -> TargetToken
Issues a token for a case found after the turn started: a record the user named that the application’s directory looked up.
Sourcepub const fn account_id(&self) -> &AccountId
pub const fn account_id(&self) -> &AccountId
The account every lookup is scoped to.
Sourcepub const fn token_map(&self) -> &TargetTokenMap
pub const fn token_map(&self) -> &TargetTokenMap
The token map.
Sourcepub fn catalog(&self) -> Vec<TargetCandidate>
pub fn catalog(&self) -> Vec<TargetCandidate>
Every case in view, by token and label.
Sourcepub fn catalog_for(&self, workflow: &WorkflowKey) -> Vec<TargetCandidate>
pub fn catalog_for(&self, workflow: &WorkflowKey) -> Vec<TargetCandidate>
The cases in view of one workflow.
Sourcepub fn candidate(&self, token: &TargetToken) -> Option<&AuthorizedCase>
pub fn candidate(&self, token: &TargetToken) -> Option<&AuthorizedCase>
The authorized case behind a token.
Sourcepub fn in_view(&self) -> impl Iterator<Item = &AuthorizedCase>
pub fn in_view(&self) -> impl Iterator<Item = &AuthorizedCase>
Every authorized case in view, in the order admitted.
Sourcepub const fn active_interaction(&self) -> Option<&ActiveInteractionSummary>
pub const fn active_interaction(&self) -> Option<&ActiveInteractionSummary>
The card on screen, when there is one.
Sourcepub fn resolve_origin(&self, origin: &OriginToken) -> TargetResolution
pub fn resolve_origin(&self, origin: &OriginToken) -> TargetResolution
Resolves a server-validated origin reference (§12.4): bound resolves exactly,
unbound is Unauthorized, so a guessed token reveals nothing.
Sourcepub fn origin_token(&self, origin: &OriginToken) -> Option<&TargetToken>
pub fn origin_token(&self, origin: &OriginToken) -> Option<&TargetToken>
The target token that stands for a bound origin, if any.
Sourcepub fn resolve(
&self,
act: &UnderstoodAct,
spec: Option<&OperationSpec>,
same_turn: &BTreeMap<ActId, CaseRef>,
) -> TargetOutcome
pub fn resolve( &self, act: &UnderstoodAct, spec: Option<&OperationSpec>, same_turn: &BTreeMap<ActId, CaseRef>, ) -> TargetOutcome
Resolves one act’s target. spec is its operation, absent for a start;
same_turn maps the acts of this turn that open a case to the case they open.