pub struct Lineups {
pub editor: Option<Editor>,
pub chosen: Option<String>,
}Expand description
The lineups dialog, while it is open.
Fields§
§editor: Option<Editor>The lineup being written, or nothing while the list of them stands in its place.
chosen: Option<String>The lineup the person is looking at, named rather than numbered: a lineup saved or deleted under the person must not move the list out from under their hand.
Implementations§
Source§impl Lineups
impl Lineups
Sourcepub fn new() -> Self
pub fn new() -> Self
The dialog as it opens: the list, with nothing chosen and nothing being written.
Sourcepub fn editing(&self, name: &str) -> bool
pub fn editing(&self, name: &str) -> bool
Whether a lineup called name is the one being written, which is what decides whether the
name is free.
Sourcepub fn steps(&self) -> &[String]
pub fn steps(&self) -> &[String]
The steps of the lineup being written, in the order they are tried.
Sourcepub fn step(&self) -> usize
pub fn step(&self) -> usize
The step the person is looking at, while a lineup is being written.
Sourcepub fn refusal(&self) -> Option<&Refusal>
pub fn refusal(&self) -> Option<&Refusal>
What stopped the lineup being saved last time, as the view turns it into words.
Sourcepub fn shown<'a>(&self, entry: &'a ProviderEntry) -> Vec<&'a Model>
pub fn shown<'a>(&self, entry: &'a ProviderEntry) -> Vec<&'a Model>
The provider’s models the filter keeps, in the provider’s own order.
A service such as OpenRouter offers hundreds of models and a dialog holds a handful, so the list shows what is asked for. What the filter hides is not thrown away: a step already in the lineup stays in it, and the line under the name says so.
Sourcepub fn paid<'a>(&self, entry: &'a ProviderEntry) -> Vec<&'a str>
pub fn paid<'a>(&self, entry: &'a ProviderEntry) -> Vec<&'a str>
The steps that cost money, said as Lineup::paid would say it for a saved one: the
person hears it while they are choosing the order rather than from a bill afterwards.
There is no lineup yet to ask, so the steps are read off the editor.
Sourcepub fn open(&mut self, entry: &ProviderEntry)
pub fn open(&mut self, entry: &ProviderEntry)
The first lineup of entry, so that Edit and Delete act on something the moment the
dialog opens rather than waiting for a row to be pointed at.
Sourcepub fn kept(&mut self, names: &[String])
pub fn kept(&mut self, names: &[String])
Puts the choice on a lineup that is still there after the one under the hand is gone, and on the first of what is left when the one under the hand is the one that went. The names are the list as it is now, read after the deletion rather than before it.
Sourcepub fn choose(&mut self, name: &str)
pub fn choose(&mut self, name: &str)
The lineup called name is the one the person is looking at.
Sourcepub fn new_lineup(&mut self)
pub fn new_lineup(&mut self)
Starts a lineup that is not there yet. Nothing of another is carried into it: its steps are its own.
Sourcepub fn edit(&mut self, lineup: &Lineup)
pub fn edit(&mut self, lineup: &Lineup)
Starts the lineup lineup for changing, with its own name and steps in the fields.
Sourcepub fn name(&mut self, text: String)
pub fn name(&mut self, text: String)
The name as it has been typed. A form does not complain about a field nobody has finished, so what was said before is taken back as soon as it is written in.
Sourcepub fn filter_for(&mut self, text: String)
pub fn filter_for(&mut self, text: String)
What has been written above the list of the provider’s models.
Sourcepub fn look_at(&mut self, id: &str)
pub fn look_at(&mut self, id: &str)
The model the person is looking at in the list of the provider’s models.
Sourcepub fn add(&mut self, id: &str)
pub fn add(&mut self, id: &str)
Puts the model id at the end of the lineup.
The same model twice would send the same request to it twice and fall back to it twice, so a step already in the lineup is not put in again: the list of steps, right under the one that was pressed, is where that is visible.
Sourcepub fn up(&mut self)
pub fn up(&mut self)
Moves the chosen step one place earlier. The first step has nowhere earlier to go, and a request that failed on it is what the order is for.
Sourcepub fn down(&mut self)
pub fn down(&mut self)
Moves the chosen step one place later. The last step has nowhere later to go.
Trait Implementations§
impl Eq for Lineups
impl StructuralPartialEq for Lineups
Auto Trait Implementations§
impl Freeze for Lineups
impl RefUnwindSafe for Lineups
impl Send for Lineups
impl Sync for Lineups
impl Unpin for Lineups
impl UnsafeUnpin for Lineups
impl UnwindSafe for Lineups
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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