pub struct SearchEntry {Show 20 fields
pub within: Option<String>,
pub row: Option<SearchRow>,
pub anchor: Option<String>,
pub title: String,
pub text: String,
pub action: Option<ActionAddress>,
pub group: Option<String>,
pub subtitle: Option<String>,
pub icon: Option<String>,
pub kind: Option<IndexKind>,
pub people: Vec<IndexPerson>,
pub place: Option<IndexPerson>,
pub when: Option<i64>,
pub preview: Option<SearchPreview>,
pub boost: i32,
pub body: Option<SearchBody>,
pub fields: Vec<(String, SearchWeight)>,
pub facets: Vec<(String, String, String)>,
pub secret: bool,
pub picture: Option<String>,
}Expand description
A search index entry. anchor addresses what a hit opens (an item id);
action, when set, is the published action a hit invokes, so choosing it
goes through the same API, permissions and history as the palette.
How a hit reads is the entry’s too: the result group it is listed under
(the resource’s label unless group names another, such as “Timeline
markers”), a dimmer subtitle line, a named icon (a lucide kebab name,
"star"), and a boost that floats pinned or recent items over an equal
match. Long prose an entry is found by — a book’s chapter, a long note —
is its body, which the index reads in place rather than the entry
copying it, and whose segments may each be a hit of their own.
Fields§
§within: Option<String>The containing resource scope for a flat anchor.
row: Option<SearchRow>Presentation for the platform-rendered result row.
anchor: Option<String>§title: String§text: String§action: Option<ActionAddress>§group: Option<String>§subtitle: Option<String>§icon: Option<String>§kind: Option<IndexKind>What kind of thing it is, where the shell’s generic rows would read poorly: an agent, a conversation, a message.
people: Vec<IndexPerson>Who the row shows, in the order people read them: the first is its avatar, the rest its faces.
place: Option<IndexPerson>Where it is, for a message: the conversation it sits in.
when: Option<i64>When it happened, in seconds since the Unix epoch.
preview: Option<SearchPreview>What the palette shows of the hit while a person is on it; None
shows its text, and an entry with neither shows no preview.
boost: i32§body: Option<SearchBody>§fields: Vec<(String, SearchWeight)>More short text the entry is found by, each ranked by its own weight: a sender’s address, a book’s subject, a message’s labels.
facets: Vec<(String, String, String)>Structured filter values: token key, localized group label, value.
secret: boolThe entry describes a secret (a vault’s login): the system index
keeps its metadata but finds it only while the app reports its
secrets unlocked (SearchEntry::secret_bearing).
picture: Option<String>The picture the entry is about, as its address in the content store: what the system’s image analysis reads, so the picture is found by the words in it and by what it shows.
Implementations§
Source§impl SearchEntry
impl SearchEntry
Sourcepub fn facet(
self,
key: impl Into<String>,
label: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn facet( self, key: impl Into<String>, label: impl Into<String>, value: impl Into<String>, ) -> Self
Offer this entry under one value of a platform search facet.
Sourcepub fn in_scope(&self, scope: &str) -> bool
pub fn in_scope(&self, scope: &str) -> bool
Whether the entry lies in scope: its anchor, or the scope it is
within, is the scope or lies beneath it.
Sourcepub fn new(title: impl Into<String>, text: impl Into<String>) -> Self
pub fn new(title: impl Into<String>, text: impl Into<String>) -> Self
An entry titled title whose body text is text.
Sourcepub fn inside(self, scope: impl Into<String>) -> Self
pub fn inside(self, scope: impl Into<String>) -> Self
List the hit inside the scope scope (an item’s anchor) though its
own anchor lies elsewhere: an article in its feed’s scope, related by
a field rather than by nesting.
Sourcepub fn invoking(self, action: ActionAddress) -> Self
pub fn invoking(self, action: ActionAddress) -> Self
The published action a hit invokes.
Sourcepub fn opening<E: Effect>(self, row: impl Into<String>, effect: &E) -> Self
pub fn opening<E: Effect>(self, row: impl Into<String>, effect: &E) -> Self
Anchored at the live row row, opened by running effect, the
view effect that row offers (go to a bookmark, show a find match):
for a hit whose row is the window’s own state rather than an item
of the record.
Sourcepub fn grouped(self, group: impl Into<String>) -> Self
pub fn grouped(self, group: impl Into<String>) -> Self
List hits under group rather than the resource’s label.
Sourcepub fn subtitled(self, subtitle: impl Into<String>) -> Self
pub fn subtitled(self, subtitle: impl Into<String>) -> Self
A secondary line under the title: where the item is, what it is.
Sourcepub fn with_icon(self, icon: impl Into<String>) -> Self
pub fn with_icon(self, icon: impl Into<String>) -> Self
The glyph a hit leads with, by its lucide kebab name ("star").
Sourcepub fn of_kind(self, kind: IndexKind) -> Self
pub fn of_kind(self, kind: IndexKind) -> Self
What kind of thing it is, where the shell’s generic rows would read poorly: an agent, a conversation, a message.
Sourcepub fn showing(self, people: Vec<IndexPerson>) -> Self
pub fn showing(self, people: Vec<IndexPerson>) -> Self
Who the row shows, in the order people read them: the first is its avatar, the rest its faces.
Sourcepub fn in_place(self, place: IndexPerson) -> Self
pub fn in_place(self, place: IndexPerson) -> Self
Where it is, for a message: the conversation it sits in.
Sourcepub fn previewed(self, preview: SearchPreview) -> Self
pub fn previewed(self, preview: SearchPreview) -> Self
What the palette shows of the hit while a person is on it, in place of its text.
Sourcepub fn boosted(self, boost: i32) -> Self
pub fn boosted(self, boost: i32) -> Self
Rank the hit boost above an equal match: a nudge, never an
override of how well it matches.
Sourcepub fn field(self, text: impl Into<String>, weight: SearchWeight) -> Self
pub fn field(self, text: impl Into<String>, weight: SearchWeight) -> Self
Find the entry by text too, a match in it ranked as weight.
Sourcepub fn with_body(self, body: SearchBody) -> Self
pub fn with_body(self, body: SearchBody) -> Self
Find the entry by body too, read in place.
Sourcepub fn secret_bearing(self) -> Self
pub fn secret_bearing(self) -> Self
Mark the entry as describing a secret. The app publishes metadata only (a name, a username, a site, never the secret), and the system’s search finds the entry only while the app reports its secrets unlocked; while they are locked a match offers to unlock the app instead.
Trait Implementations§
Source§impl Clone for SearchEntry
impl Clone for SearchEntry
Source§impl Debug for SearchEntry
impl Debug for SearchEntry
Source§impl Default for SearchEntry
impl Default for SearchEntry
impl Eq for SearchEntry
Auto Trait Implementations§
impl !RefUnwindSafe for SearchEntry
impl !UnwindSafe for SearchEntry
impl Forget for SearchEntry
impl Freeze for SearchEntry
impl Move for SearchEntry
impl Send for SearchEntry
impl Sync for SearchEntry
impl Unpin for SearchEntry
impl UnsafeUnpin for SearchEntry
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> 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> ⓘ
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