Struct IndexEntry
pub struct IndexEntry {Show 16 fields
pub key: String,
pub resource: String,
pub action: Option<IndexAction>,
pub title: String,
pub subtitle: Option<String>,
pub group: Option<String>,
pub kind: Option<IndexKind>,
pub people: Vec<IndexPerson>,
pub keeper: Option<IndexPerson>,
pub place: Option<IndexPerson>,
pub when: Option<i64>,
pub icon: Option<String>,
pub boost: i32,
pub fields: Vec<(String, IndexWeight)>,
pub secret: bool,
pub references: Vec<String>,
}Expand description
One search entry, as the system index keeps it.
Fields§
§key: StringStable within the app’s publication: the resource id, or the resource and action a hit invokes.
resource: StringThe stable resource id a hit opens: the entry’s anchor, else the
resource of its action. Without an action (or once it is gone) a
hit opens the app here through its open action.
action: Option<IndexAction>The published action a hit invokes, when the entry names one.
title: String§subtitle: Option<String>§group: Option<String>The result group the app lists the entry under (“Passwords”).
kind: Option<IndexKind>What kind of thing it is, when the app keeps something the desk’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. The sender of a message, the people in a conversation, the agent itself.
keeper: Option<IndexPerson>Who keeps it, for an agent: the row says so, and “you” when it is the person searching.
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: the row says how long ago.
icon: Option<String>A named icon (a lucide kebab name).
boost: i32A nudge over an equal match (a favourite), never an override.
fields: Vec<(String, IndexWeight)>More short text the entry is found by, each with its weight.
secret: boolThe entry describes a secret: found only while the app reports its secrets unlocked.
references: Vec<String>What its text refers to, each in the one form a reference in rich
text is written in (tilo_reference::embed): the system index finds
the entry by what each is called now, not by the title written into
the text, and answers which entries refer to a resource (its
backlinks).
Implementations§
§impl IndexEntry
impl IndexEntry
pub fn bounded(self) -> Option<IndexEntry>
pub fn bounded(self) -> Option<IndexEntry>
The entry within this module’s bounds: texts cut, fields capped,
empty fields dropped. None for an entry with nothing to find it by
or nothing to open.
pub fn searchable(&self) -> impl Iterator<Item = (&str, IndexWeight)>
pub fn searchable(&self) -> impl Iterator<Item = (&str, IndexWeight)>
Every text the entry is found by, with its weight: its title, its secondary line and its fields.
Trait Implementations§
§impl Clone for IndexEntry
impl Clone for IndexEntry
§fn clone(&self) -> IndexEntry
fn clone(&self) -> IndexEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for IndexEntry
impl Debug for IndexEntry
§impl Default for IndexEntry
impl Default for IndexEntry
§fn default() -> IndexEntry
fn default() -> IndexEntry
§impl<'de> Deserialize<'de> for IndexEntry
impl<'de> Deserialize<'de> for IndexEntry
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IndexEntry, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IndexEntry, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for IndexEntry
impl PartialEq for IndexEntry
§impl Serialize for IndexEntry
impl Serialize for IndexEntry
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for IndexEntry
impl StructuralPartialEq for IndexEntry
Auto Trait Implementations§
impl Freeze for IndexEntry
impl RefUnwindSafe for IndexEntry
impl Send for IndexEntry
impl Sync for IndexEntry
impl Unpin for IndexEntry
impl UnsafeUnpin for IndexEntry
impl UnwindSafe for IndexEntry
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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>
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