pub struct SearchDocument {
pub id: String,
pub kind: String,
pub title: String,
pub summary: String,
pub content: String,
}Expand description
Searchable document contributed by commands, guides, or applications.
Fields§
§id: StringStable document id.
kind: StringDocument kind, such as command or guide.
title: StringSearch result title.
summary: StringShort snippet shown in search results.
content: StringFull searchable content.
Implementations§
Source§impl SearchDocument
impl SearchDocument
Sourcepub fn new(
id: impl Into<String>,
kind: impl Into<String>,
title: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, kind: impl Into<String>, title: impl Into<String>, ) -> Self
Creates a searchable document with title text as the default content.
Sourcepub fn with_summary(self, summary: impl Into<String>) -> Self
pub fn with_summary(self, summary: impl Into<String>) -> Self
Sets the short snippet shown in search results.
Sourcepub fn with_content(self, content: impl Into<String>) -> Self
pub fn with_content(self, content: impl Into<String>) -> Self
Sets the full searchable content.
Trait Implementations§
Source§impl Clone for SearchDocument
impl Clone for SearchDocument
Source§fn clone(&self) -> SearchDocument
fn clone(&self) -> SearchDocument
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SearchDocument
impl Debug for SearchDocument
Source§impl PartialEq for SearchDocument
impl PartialEq for SearchDocument
Source§fn eq(&self, other: &SearchDocument) -> bool
fn eq(&self, other: &SearchDocument) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SearchDocument
Auto Trait Implementations§
impl Freeze for SearchDocument
impl RefUnwindSafe for SearchDocument
impl Send for SearchDocument
impl Sync for SearchDocument
impl Unpin for SearchDocument
impl UnsafeUnpin for SearchDocument
impl UnwindSafe for SearchDocument
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