Skip to main content

CompositionInput

Struct CompositionInput 

Source
#[non_exhaustive]
pub struct CompositionInput<'a> {
Show 25 fields pub turn: &'a TurnInput, pub attachments: Vec<ContentPart>, pub answer_tasks: &'a [AnswerTask], pub events: &'a [EventBatch], pub ledger: &'a [LedgerReceiptGroup], pub interactions: &'a [Interaction], pub views: &'a [ErasedWorkflowView], pub subjects: &'a [CaseKey], pub touched: &'a [CaseKey], pub beside: &'a [CaseKey], pub reachable_only: &'a [CaseKey], pub recent: &'a [RecentMessage], pub preceding_reply: Option<&'a str>, pub artifacts_shown: &'a [BlockId], pub case_labels: &'a [CaseLabel], pub next_steps: &'a [(CaseKey, Vec<LocalizedText>)], pub named_workflows: &'a [WorkflowKey], pub unavailable: &'a [UnavailableWorkflow], pub disputes: &'a [String], pub started: &'a [WorkflowKey], pub contested: &'a [String], pub notices: &'a [ServerNotice], pub refusals: &'a [NarratableFact], pub outcomes: OutcomeFlags, pub effort: Option<&'a EffortProfile>,
}
Expand description

Everything one composition reads.

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.
§turn: &'a TurnInput

The turn being answered.

§attachments: Vec<ContentPart>

The turn’s files, for the stage that answers.

§answer_tasks: &'a [AnswerTask]

The questions the reducer produced, with their basis.

§events: &'a [EventBatch]

Event batches that committed, in commit order.

§ledger: &'a [LedgerReceiptGroup]

Ledger groups read back from the journal, used instead of Self::events when a response is regenerated: a stored event may have been redacted since.

§interactions: &'a [Interaction]

Cards on screen after the turn.

§views: &'a [ErasedWorkflowView]

The cases as they now stand.

§subjects: &'a [CaseKey]

The cases the turn was about.

§touched: &'a [CaseKey]

The cases an act of the turn reached, in act order: where the ask comes from.

§beside: &'a [CaseKey]

Other cases in view the ask may move on to once the touched ones need nothing.

§reachable_only: &'a [CaseKey]

Cases in view only because the actor may reach them.

§recent: &'a [RecentMessage]

The earlier messages, oldest first.

§preceding_reply: Option<&'a str>

The reply just before this turn.

§artifacts_shown: &'a [BlockId]

Artifact blocks the conversation already carries.

§case_labels: &'a [CaseLabel]

What each case is called.

§next_steps: &'a [(CaseKey, Vec<LocalizedText>)]

What each case lets the user do next once it owes nothing, by case.

§named_workflows: &'a [WorkflowKey]

Workflows the turn named.

§unavailable: &'a [UnavailableWorkflow]

Workflows that cannot start, with their reasons.

§disputes: &'a [String]

What the user said the assistant got wrong.

§started: &'a [WorkflowKey]

Workflows the turn started without writing anything yet.

§contested: &'a [String]

Receipts of the last reply the user contested, as they were shown.

§notices: &'a [ServerNotice]

Notices the turn already carries.

§refusals: &'a [NarratableFact]

What the reduction and the execution decided, as facts.

§outcomes: OutcomeFlags

Deterministic outcome flags.

§effort: Option<&'a EffortProfile>

The effort the turn runs at: its reply budget and task profiles.

Implementations§

Source§

impl<'a> CompositionInput<'a>

Source

pub fn new(turn: &'a TurnInput) -> Self

An input with nothing but the turn.

Source§

impl<'a> CompositionInput<'a>

Source

pub fn with_attachments(self, value: Vec<ContentPart>) -> Self

Sets the turn’s files.

Source

pub fn with_answer_tasks(self, value: &'a [AnswerTask]) -> Self

Sets the questions.

Source

pub fn with_events(self, value: &'a [EventBatch]) -> Self

Sets the committed events.

Source

pub fn with_ledger(self, value: &'a [LedgerReceiptGroup]) -> Self

Sets the ledger groups of a regenerated response.

Source

pub fn with_interactions(self, value: &'a [Interaction]) -> Self

Sets the cards on screen.

Source

pub fn with_views(self, value: &'a [ErasedWorkflowView]) -> Self

Sets the views.

Source

pub fn with_subjects(self, value: &'a [CaseKey]) -> Self

Sets the subjects.

Source

pub fn with_touched(self, value: &'a [CaseKey]) -> Self

Sets the cases an act reached.

Source

pub fn with_beside(self, value: &'a [CaseKey]) -> Self

Sets the cases the ask may move on to.

Source

pub fn with_reachable_only(self, value: &'a [CaseKey]) -> Self

Sets the cases in view only because they are reachable.

Source

pub fn with_recent(self, value: &'a [RecentMessage]) -> Self

Sets the earlier messages.

Source

pub fn with_preceding_reply(self, value: Option<&'a str>) -> Self

Sets the reply just before this turn.

Source

pub fn with_artifacts_shown(self, value: &'a [BlockId]) -> Self

Sets the artifact blocks already shown.

Source

pub fn with_case_labels(self, value: &'a [CaseLabel]) -> Self

Sets the case labels.

Source

pub fn with_next_steps(self, value: &'a [(CaseKey, Vec<LocalizedText>)]) -> Self

Sets what each case lets the user do next.

Source

pub fn with_named_workflows(self, value: &'a [WorkflowKey]) -> Self

Sets the workflows the turn named.

Source

pub fn with_unavailable(self, value: &'a [UnavailableWorkflow]) -> Self

Sets the workflows that cannot start.

Source

pub fn with_disputes(self, value: &'a [String]) -> Self

Sets what the user disputed.

Source

pub fn with_started(self, value: &'a [WorkflowKey]) -> Self

Sets the workflows started without a write.

Source

pub fn with_contested(self, value: &'a [String]) -> Self

Sets the receipts the user contested.

Source

pub fn with_notices(self, value: &'a [ServerNotice]) -> Self

Sets the notices.

Source

pub fn with_refusals(self, value: &'a [NarratableFact]) -> Self

Sets the facts of what was decided.

Source

pub fn with_outcomes(self, value: OutcomeFlags) -> Self

Sets the outcome flags.

Source

pub fn with_effort(self, value: Option<&'a EffortProfile>) -> Self

Sets the effort the turn runs at.

Trait Implementations§

Source§

impl<'a> Clone for CompositionInput<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for CompositionInput<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CompositionInput<'a>

§

impl<'a> RefUnwindSafe for CompositionInput<'a>

§

impl<'a> Send for CompositionInput<'a>

§

impl<'a> Sync for CompositionInput<'a>

§

impl<'a> Unpin for CompositionInput<'a>

§

impl<'a> UnsafeUnpin for CompositionInput<'a>

§

impl<'a> UnwindSafe for CompositionInput<'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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more