pub struct TextSnippet {
pub trigger: String,
pub body: String,
pub description: Option<String>,
pub keywords: Vec<String>,
}Fields§
§trigger: String§body: String§description: Option<String>§keywords: Vec<String>Implementations§
Source§impl TextSnippet
impl TextSnippet
pub fn new(trigger: impl Into<String>, body: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_keywords( self, keywords: impl IntoIterator<Item = impl Into<String>>, ) -> Self
pub fn score(&self, query: &str) -> Option<f32>
Trait Implementations§
Source§impl Clone for TextSnippet
impl Clone for TextSnippet
Source§fn clone(&self) -> TextSnippet
fn clone(&self) -> TextSnippet
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 TextSnippet
impl Debug for TextSnippet
Source§impl<'de> Deserialize<'de> for TextSnippet
impl<'de> Deserialize<'de> for TextSnippet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TextSnippet
Source§impl PartialEq for TextSnippet
impl PartialEq for TextSnippet
Source§fn eq(&self, other: &TextSnippet) -> bool
fn eq(&self, other: &TextSnippet) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TextSnippet
impl Serialize for TextSnippet
impl StructuralPartialEq for TextSnippet
Auto Trait Implementations§
impl Freeze for TextSnippet
impl RefUnwindSafe for TextSnippet
impl Send for TextSnippet
impl Sync for TextSnippet
impl Unpin for TextSnippet
impl UnsafeUnpin for TextSnippet
impl UnwindSafe for TextSnippet
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