pub struct EditSelectionState {
pub messages: Vec<(String, String)>,
pub selected_index: usize,
pub hovered_id: Option<String>,
}Expand description
State for the edit selection widget
Fields§
§messages: Vec<(String, String)>§selected_index: usize§hovered_id: Option<String>Implementations§
Source§impl EditSelectionState
impl EditSelectionState
Sourcepub fn select_prev(&mut self) -> Option<&(String, String)>
pub fn select_prev(&mut self) -> Option<&(String, String)>
Move selection to previous message
Sourcepub fn select_next(&mut self) -> Option<&(String, String)>
pub fn select_next(&mut self) -> Option<&(String, String)>
Move selection to next message
Sourcepub fn get_selected(&self) -> Option<&(String, String)>
pub fn get_selected(&self) -> Option<&(String, String)>
Get currently selected message
Sourcepub fn populate_from_chat_items<'a>(
&mut self,
chat_items: impl Iterator<Item = &'a ChatItem>,
)
pub fn populate_from_chat_items<'a>( &mut self, chat_items: impl Iterator<Item = &'a ChatItem>, )
Populate the selection with messages from chat items
Sourcepub fn get_hovered_id(&self) -> Option<&str>
pub fn get_hovered_id(&self) -> Option<&str>
Get the ID of the currently hovered message
Trait Implementations§
Source§impl Debug for EditSelectionState
impl Debug for EditSelectionState
Source§impl Default for EditSelectionState
impl Default for EditSelectionState
Source§fn default() -> EditSelectionState
fn default() -> EditSelectionState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EditSelectionState
impl RefUnwindSafe for EditSelectionState
impl Send for EditSelectionState
impl Sync for EditSelectionState
impl Unpin for EditSelectionState
impl UnwindSafe for EditSelectionState
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request