pub struct Thesaurus { /* private fields */ }Expand description
A thesaurus is a dictionary with synonyms which map to upper-level concepts.
Implementations§
Source§impl Thesaurus
impl Thesaurus
Sourcepub fn insert(&mut self, key: NormalizedTermValue, value: NormalizedTerm)
pub fn insert(&mut self, key: NormalizedTermValue, value: NormalizedTerm)
Inserts a key-value pair into the thesaurus.
Sourcepub fn get(&self, key: &NormalizedTermValue) -> Option<&NormalizedTerm>
pub fn get(&self, key: &NormalizedTermValue) -> Option<&NormalizedTerm>
Custom get method for the thesaurus, which accepts a
NormalizedTermValue and returns a reference to the
NormalizedTerm.
pub fn keys(&self) -> Keys<'_, NormalizedTermValue, NormalizedTerm>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Thesaurus
impl<'de> Deserialize<'de> for Thesaurus
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Thesaurus, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Thesaurus, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> IntoIterator for &'a Thesaurus
impl<'a> IntoIterator for &'a Thesaurus
Source§type Item = (&'a NormalizedTermValue, &'a NormalizedTerm)
type Item = (&'a NormalizedTermValue, &'a NormalizedTerm)
The type of the elements being iterated over.
Source§type IntoIter = Iter<'a, NormalizedTermValue, NormalizedTerm>
type IntoIter = Iter<'a, NormalizedTermValue, NormalizedTerm>
Which kind of iterator are we turning this into?
Source§impl Serialize for Thesaurus
impl Serialize for Thesaurus
Source§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,
Serialize this value into the given Serde serializer. Read more
impl Eq for Thesaurus
impl StructuralPartialEq for Thesaurus
Auto Trait Implementations§
impl Freeze for Thesaurus
impl RefUnwindSafe for Thesaurus
impl Send for Thesaurus
impl Sync for Thesaurus
impl Unpin for Thesaurus
impl UnwindSafe for Thesaurus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.