ElicitResult

Result of the elicitation/create request (client/elicitation).

action is the user's decision (accept / decline / cancel). For an accept, content carries the collected values keyed by schema property name (each a string, number, boolean, or string array per the schema); it is omitted for decline/cancel.

Members

Functions

contentAs
T contentAs()

Decode the accept content map (values keyed by schema property name) into a typed struct T. Pairs with RequestContext.elicit!T, whose requestedSchema is derived from the same T. Only meaningful for an accept; on a decline/cancel (no content) this returns T.init, so callers should branch on action first.

Static functions

accept
ElicitResult accept(Json content)

Convenience constructor for an accept carrying collected content.

accept
ElicitResult accept(T value)

Convenience constructor for an accept whose collected content is built by serializing a typed struct T (symmetric with contentAs!T). The struct fields become the {name: value} content map, so accept!T(v).contentAs!T round-trips.

cancel
ElicitResult cancel()

Convenience constructor for a cancel (no content).

decline
ElicitResult decline()

Convenience constructor for a decline (no content).

Variables

action
ElicitAction action;

the user's decision

content
Json content;

accept: the collected {name: value} map

Mixed In Members

From mixin MetaField

meta
Json meta;

optional _meta object