pub struct ChatInputWidget {
pub text: String,
pub cursor: usize,
pub history: Vec<String>,
pub history_index: Option<usize>,
pub intent: Intent,
}Expand description
Chat input widget
Fields§
§text: StringCurrent input text
cursor: usizeCursor position
history: Vec<String>Input history
history_index: Option<usize>History index
intent: IntentDetected intent
Implementations§
Source§impl ChatInputWidget
impl ChatInputWidget
Sourcepub fn insert_char(&mut self, ch: char)
pub fn insert_char(&mut self, ch: char)
Insert character at cursor
Sourcepub fn move_right(&mut self)
pub fn move_right(&mut self)
Move cursor right
Sourcepub fn move_start(&mut self)
pub fn move_start(&mut self)
Move cursor to start
Sourcepub fn history_up(&mut self)
pub fn history_up(&mut self)
Navigate history up
Sourcepub fn history_down(&mut self)
pub fn history_down(&mut self)
Navigate history down
Sourcepub fn update_intent(&mut self)
pub fn update_intent(&mut self)
Update detected intent
Sourcepub fn suggestions(&self) -> Vec<&'static str>
pub fn suggestions(&self) -> Vec<&'static str>
Get suggested commands
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChatInputWidget
impl RefUnwindSafe for ChatInputWidget
impl Send for ChatInputWidget
impl Sync for ChatInputWidget
impl Unpin for ChatInputWidget
impl UnwindSafe for ChatInputWidget
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