Enum SearchRow
pub enum SearchRow {
Message {
sender: String,
subject: String,
snippet: Option<String>,
date: Option<String>,
unread: bool,
},
Media {
thumbnail: Option<AppImage>,
title: String,
byline: Option<String>,
duration: Option<String>,
},
FileHit {
path: String,
line: Option<u32>,
snippet: String,
matched: Option<Range<usize>>,
},
}Expand description
The shape of one search hit’s row.
Variants§
Message
A message: who sent it, its subject, a snippet of its body, when it arrived, and whether it is unread (a dot before the sender).
Media
A video, track or other media item: its thumbnail, title, who made it (the channel or artist), and its duration.
FileHit
A match inside a file: the file’s path, the line, and the matched line
itself with the matched span marked (byte range into snippet).
Implementations§
§impl SearchRow
impl SearchRow
pub fn file_hit(
path: impl Into<String>,
snippet: impl Into<String>,
) -> SearchRow
pub fn file_hit( path: impl Into<String>, snippet: impl Into<String>, ) -> SearchRow
A file-hit row for snippet, the matched line of path.
pub fn snippet(self, text: impl Into<String>) -> SearchRow
pub fn snippet(self, text: impl Into<String>) -> SearchRow
The message’s body snippet, or a file hit’s matched line.
pub fn date(self, text: impl Into<String>) -> SearchRow
pub fn date(self, text: impl Into<String>) -> SearchRow
When a message arrived, already formatted (“Tue”, “12 Mar”).
pub fn unread(self, on: bool) -> SearchRow
pub fn thumbnail(self, image: AppImage) -> SearchRow
pub fn byline(self, text: impl Into<String>) -> SearchRow
pub fn byline(self, text: impl Into<String>) -> SearchRow
The channel, artist or author of a media item.
pub fn duration(self, text: impl Into<String>) -> SearchRow
pub fn duration(self, text: impl Into<String>) -> SearchRow
A media item’s duration, already formatted (“12:04”).
Trait Implementations§
impl StructuralPartialEq for SearchRow
Auto Trait Implementations§
impl Freeze for SearchRow
impl !RefUnwindSafe for SearchRow
impl Send for SearchRow
impl Sync for SearchRow
impl Unpin for SearchRow
impl UnsafeUnpin for SearchRow
impl !UnwindSafe for SearchRow
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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