pub struct ModelSelectorState {
pub models: Vec<ModelMeta>,
pub filter: String,
pub selected: usize,
pub current_model: String,
}Expand description
State for the model selector overlay.
Fields§
§models: Vec<ModelMeta>§filter: String§selected: usize§current_model: StringImplementations§
Source§impl ModelSelectorState
impl ModelSelectorState
pub fn new(models: Vec<ModelMeta>, current_model: String) -> Self
pub fn filtered(&self) -> Vec<&ModelMeta>
pub fn custom_model(&self) -> Option<String>
pub fn move_up(&mut self)
pub fn move_down(&mut self)
pub fn push_filter(&mut self, c: char)
pub fn pop_filter(&mut self)
pub fn selected_choice(&self) -> Option<ModelSelection<'_>>
Trait Implementations§
Source§impl Clone for ModelSelectorState
impl Clone for ModelSelectorState
Source§fn clone(&self) -> ModelSelectorState
fn clone(&self) -> ModelSelectorState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ModelSelectorState
impl RefUnwindSafe for ModelSelectorState
impl Send for ModelSelectorState
impl Sync for ModelSelectorState
impl Unpin for ModelSelectorState
impl UnsafeUnpin for ModelSelectorState
impl UnwindSafe for ModelSelectorState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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