pub struct SnippetSet {
pub snippets: Vec<TextSnippet>,
}Fields§
§snippets: Vec<TextSnippet>Implementations§
Source§impl SnippetSet
impl SnippetSet
pub fn new(snippets: impl IntoIterator<Item = TextSnippet>) -> Self
pub fn expand(&self, trigger: &str) -> Option<&str>
pub fn matches(&self, query: &str) -> Vec<&TextSnippet>
pub fn matches_limited(&self, query: &str, limit: usize) -> Vec<&TextSnippet>
Trait Implementations§
Source§impl Clone for SnippetSet
impl Clone for SnippetSet
Source§fn clone(&self) -> SnippetSet
fn clone(&self) -> SnippetSet
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 SnippetSet
impl Debug for SnippetSet
Source§impl Default for SnippetSet
impl Default for SnippetSet
Source§fn default() -> SnippetSet
fn default() -> SnippetSet
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SnippetSet
impl<'de> Deserialize<'de> for SnippetSet
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 SnippetSet
Source§impl PartialEq for SnippetSet
impl PartialEq for SnippetSet
Source§fn eq(&self, other: &SnippetSet) -> bool
fn eq(&self, other: &SnippetSet) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SnippetSet
impl Serialize for SnippetSet
impl StructuralPartialEq for SnippetSet
Auto Trait Implementations§
impl Freeze for SnippetSet
impl RefUnwindSafe for SnippetSet
impl Send for SnippetSet
impl Sync for SnippetSet
impl Unpin for SnippetSet
impl UnsafeUnpin for SnippetSet
impl UnwindSafe for SnippetSet
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