pub struct PickerItem<T> {
pub key: T,
pub label: String,
pub score: Option<f64>,
}Expand description
Re-exported so consumers build items without depending on egaku directly.
escriba’s crates speak to the fleet library through THIS module; a second
import path is how two versions of a type end up in one workspace.
One row the picker can display + commit. Plain data — the caller
owns key; the picker only reads label (for fuzzy filtering +
display) and the optional frecency score.
Fields§
§key: TThe value handed back on accept (PickerEffect::Accepted).
label: StringThe display + fuzzy-match text (e.g. "🌊 tide mado").
score: Option<f64>Optional frecency / priority weight. Higher sorts first. Used as
a tiebreak when fuzzy match quality is equal, and as the sole
ordering when the query is empty (everything matches → rank by
frecency). None is treated as 0.0.
Implementations§
Source§impl<T> PickerItem<T>
impl<T> PickerItem<T>
Sourcepub fn new(key: T, label: impl Into<String>) -> PickerItem<T>
pub fn new(key: T, label: impl Into<String>) -> PickerItem<T>
A picker row with no frecency weight (a plain fuzzy chooser).
Sourcepub fn with_score(key: T, label: impl Into<String>, score: f64) -> PickerItem<T>
pub fn with_score(key: T, label: impl Into<String>, score: f64) -> PickerItem<T>
A picker row carrying a frecency / priority weight.
Trait Implementations§
Source§impl<T> Clone for PickerItem<T>where
T: Clone,
impl<T> Clone for PickerItem<T>where
T: Clone,
Source§fn clone(&self) -> PickerItem<T>
fn clone(&self) -> PickerItem<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more