pub struct MicroscopeItem {
pub id: String,
pub display: String,
pub detail: Option<String>,
pub data: MicroscopeData,
pub score: Option<u32>,
pub icon: Option<char>,
pub source: &'static str,
}Expand description
Represents a single item in the microscope results list
Fields§
§id: StringUnique identifier for this item
display: StringPrimary display text
detail: Option<String>Secondary detail text (optional, shown grayed out)
data: MicroscopeDataData for determining action on selection
score: Option<u32>Fuzzy match score (higher = better match)
icon: Option<char>Icon/indicator character
source: &'static strSource picker name
Implementations§
Source§impl MicroscopeItem
impl MicroscopeItem
Sourcepub fn new(
id: impl Into<String>,
display: impl Into<String>,
data: MicroscopeData,
source: &'static str,
) -> Self
pub fn new( id: impl Into<String>, display: impl Into<String>, data: MicroscopeData, source: &'static str, ) -> Self
Create a new microscope item
Sourcepub fn with_detail(self, detail: impl Into<String>) -> Self
pub fn with_detail(self, detail: impl Into<String>) -> Self
Set detail text
Sourcepub const fn with_score(self, score: u32) -> Self
pub const fn with_score(self, score: u32) -> Self
Set match score
Sourcepub fn match_text(&self) -> &str
pub fn match_text(&self) -> &str
Get the text used for matching
Trait Implementations§
Source§impl Clone for MicroscopeItem
impl Clone for MicroscopeItem
Source§fn clone(&self) -> MicroscopeItem
fn clone(&self) -> MicroscopeItem
Returns a duplicate of the value. Read more
1.0.0 · 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 MicroscopeItem
impl RefUnwindSafe for MicroscopeItem
impl Send for MicroscopeItem
impl Sync for MicroscopeItem
impl Unpin for MicroscopeItem
impl UnwindSafe for MicroscopeItem
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