pub struct ElicitResult {
pub action: ElicitAction,
pub content: Option<HashMap<String, ElicitContentValue>>,
}Expand description
elicitation/create response result.
The client’s response to an elicitation request.
Fields§
§action: ElicitActionThe user action in response to the elicitation.
content: Option<HashMap<String, ElicitContentValue>>The submitted form data, only present when action is “accept” in form mode. Contains values matching the requested schema. For URL mode, this field is omitted.
Implementations§
Source§impl ElicitResult
impl ElicitResult
Sourcepub fn accept(content: HashMap<String, ElicitContentValue>) -> Self
pub fn accept(content: HashMap<String, ElicitContentValue>) -> Self
Creates an accept result with form data.
Sourcepub fn accept_url() -> Self
pub fn accept_url() -> Self
Creates an accept result for URL mode (no content).
Sourcepub fn is_accepted(&self) -> bool
pub fn is_accepted(&self) -> bool
Returns true if the user accepted the elicitation.
Sourcepub fn is_declined(&self) -> bool
pub fn is_declined(&self) -> bool
Returns true if the user declined the elicitation.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Returns true if the user cancelled the elicitation.
Sourcepub fn get_string(&self, key: &str) -> Option<&str>
pub fn get_string(&self, key: &str) -> Option<&str>
Gets a string value from the content.
Trait Implementations§
Source§impl Clone for ElicitResult
impl Clone for ElicitResult
Source§fn clone(&self) -> ElicitResult
fn clone(&self) -> ElicitResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElicitResult
impl Debug for ElicitResult
Source§impl<'de> Deserialize<'de> for ElicitResult
impl<'de> Deserialize<'de> for ElicitResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ElicitResult
impl RefUnwindSafe for ElicitResult
impl Send for ElicitResult
impl Sync for ElicitResult
impl Unpin for ElicitResult
impl UnwindSafe for ElicitResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).