pub struct TuiInterface { /* private fields */ }Expand description
UserInterface implementation that sends requests to the TUI event loop.
Tools and extensions call methods on this trait. The implementation sends a request to the main event loop, which renders the appropriate UI element and sends back the response.
Implementations§
Trait Implementations§
Source§impl UserInterface for TuiInterface
impl UserInterface for TuiInterface
Source§fn notify<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 str,
level: NotifyLevel,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn notify<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 str,
level: NotifyLevel,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Non-blocking notification.
Source§fn confirm<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
title: &'life1 str,
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn confirm<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
title: &'life1 str,
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Yes/no confirmation. Returns None if no UI or cancelled.
Source§fn select_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
title: &'life1 str,
context: &'life2 str,
options: &'life3 [SelectOption],
) -> Pin<Box<dyn Future<Output = Option<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn select_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
title: &'life1 str,
context: &'life2 str,
options: &'life3 [SelectOption],
) -> Pin<Box<dyn Future<Output = Option<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Select from options with context. Returns None if no UI or cancelled.
Source§fn input_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
title: &'life1 str,
context: &'life2 str,
placeholder: &'life3 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn input_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
title: &'life1 str,
context: &'life2 str,
placeholder: &'life3 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Text input with context. Returns None if no UI or cancelled.
Source§fn set_status<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
text: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_status<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
text: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Persistent status in footer.
Source§fn set_widget<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
content: Option<WidgetContent>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_widget<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
content: Option<WidgetContent>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Widget above/below editor.
Source§fn custom<'life0, 'async_trait>(
&'life0 self,
component: ComponentSpec,
) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn custom<'life0, 'async_trait>(
&'life0 self,
component: ComponentSpec,
) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Full declarative custom component. Returns the serialized result.
Source§fn select<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
title: &'life1 str,
options: &'life2 [SelectOption],
) -> Pin<Box<dyn Future<Output = Option<usize>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn select<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
title: &'life1 str,
options: &'life2 [SelectOption],
) -> Pin<Box<dyn Future<Output = Option<usize>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Select from options. Returns None if no UI or cancelled.
Source§fn input<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
title: &'life1 str,
placeholder: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn input<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
title: &'life1 str,
placeholder: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Text input. Returns None if no UI or cancelled.
Auto Trait Implementations§
impl Freeze for TuiInterface
impl RefUnwindSafe for TuiInterface
impl Send for TuiInterface
impl Sync for TuiInterface
impl Unpin for TuiInterface
impl UnsafeUnpin for TuiInterface
impl UnwindSafe for TuiInterface
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more