pub struct TuiElicitationHandler { /* private fields */ }Expand description
P5-2’s interactive elicitation UI, closing the deferred chain
crate::mcp::HeadlessElicitationHandler’s doc comment names. handle
is ASYNC (the MCP trait’s own shape), so this uses a tokio::sync:: oneshot reply rather than blocking a thread — awaiting it yields the
executor to other work while the modal is up. A dropped reply sender
(render loop gone) resolves to crate::mcp::ElicitationAction::Cancel
(the MCP spec’s own “dismissed without a decision” outcome — the
honest shape for “nobody answered”, distinct from an explicit
Decline).
Implementations§
Source§impl TuiElicitationHandler
impl TuiElicitationHandler
Sourcepub fn new(tx: Sender<PendingElicitation>) -> TuiElicitationHandler
pub fn new(tx: Sender<PendingElicitation>) -> TuiElicitationHandler
Construct a handler that feeds tx — the matching Receiver half
is TuiBridge::elicitation_rx.
Trait Implementations§
Source§impl McpElicitationHandler for TuiElicitationHandler
impl McpElicitationHandler for TuiElicitationHandler
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ElicitationRequest,
) -> Pin<Box<dyn Future<Output = ElicitationResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TuiElicitationHandler: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ElicitationRequest,
) -> Pin<Box<dyn Future<Output = ElicitationResponse> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TuiElicitationHandler: 'async_trait,
Decide how to respond to one elicitation request.
Auto Trait Implementations§
impl Freeze for TuiElicitationHandler
impl RefUnwindSafe for TuiElicitationHandler
impl Send for TuiElicitationHandler
impl Sync for TuiElicitationHandler
impl Unpin for TuiElicitationHandler
impl UnsafeUnpin for TuiElicitationHandler
impl UnwindSafe for TuiElicitationHandler
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