pub struct SessionUi<'a> { /* private fields */ }Expand description
UI sub-API for a Session — elicitation, confirmation, selection,
and free-form input.
Acquired via Session::ui. Methods route to session.ui.* RPCs and
require host elicitation support — check
session.capabilities().ui.elicitation before use.
Implementations§
Source§impl<'a> SessionUi<'a>
impl<'a> SessionUi<'a>
Sourcepub async fn elicitation(
&self,
message: &str,
schema: Value,
) -> Result<ElicitationResult, Error>
pub async fn elicitation( &self, message: &str, schema: Value, ) -> Result<ElicitationResult, Error>
Sourcepub async fn confirm(&self, message: &str) -> Result<bool, Error>
pub async fn confirm(&self, message: &str) -> Result<bool, Error>
Ask the user a yes/no confirmation question.
Returns true if the user accepted and confirmed, false otherwise.
Sourcepub async fn select(
&self,
message: &str,
options: &[&str],
) -> Result<Option<String>, Error>
pub async fn select( &self, message: &str, options: &[&str], ) -> Result<Option<String>, Error>
Ask the user to select from a list of options.
Returns the selected option string on accept, or None on decline/cancel.
Sourcepub async fn input(
&self,
message: &str,
options: Option<&InputOptions<'_>>,
) -> Result<Option<String>, Error>
pub async fn input( &self, message: &str, options: Option<&InputOptions<'_>>, ) -> Result<Option<String>, Error>
Ask the user for free-form text input.
Returns the input string on accept, or None on decline/cancel.
Use InputOptions to set validation constraints and field metadata.
Auto Trait Implementations§
impl<'a> Freeze for SessionUi<'a>
impl<'a> !RefUnwindSafe for SessionUi<'a>
impl<'a> Send for SessionUi<'a>
impl<'a> Sync for SessionUi<'a>
impl<'a> Unpin for SessionUi<'a>
impl<'a> UnsafeUnpin for SessionUi<'a>
impl<'a> !UnwindSafe for SessionUi<'a>
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