Skip to main content

SearchEntry

Struct SearchEntry 

Source
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: bool

The 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

Source

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.

Source

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.

Source

pub fn new(title: impl Into<String>, text: impl Into<String>) -> Self

An entry titled title whose body text is text.

Source

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.

Source

pub fn anchored(self, anchor: impl Into<String>) -> Self

The item a hit opens.

Source

pub fn invoking(self, action: ActionAddress) -> Self

The published action a hit invokes.

Source

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.

Source

pub fn grouped(self, group: impl Into<String>) -> Self

List hits under group rather than the resource’s label.

Source

pub fn subtitled(self, subtitle: impl Into<String>) -> Self

A secondary line under the title: where the item is, what it is.

Source

pub fn with_icon(self, icon: impl Into<String>) -> Self

The glyph a hit leads with, by its lucide kebab name ("star").

Source

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.

Source

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.

Source

pub fn in_place(self, place: IndexPerson) -> Self

Where it is, for a message: the conversation it sits in.

Source

pub fn at(self, when: i64) -> Self

When it happened, in seconds since the Unix epoch.

Source

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.

Source

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.

Source

pub fn field(self, text: impl Into<String>, weight: SearchWeight) -> Self

Find the entry by text too, a match in it ranked as weight.

Source

pub fn with_body(self, body: SearchBody) -> Self

Find the entry by body too, read in place.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SearchEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SearchEntry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for SearchEntry

Source§

impl PartialEq for SearchEntry

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more