pub struct Thesaurus {
pub source_hash: Option<String>,
/* private fields */
}Expand description
A thesaurus is a dictionary with synonyms which map to upper-level concepts.
Fields§
§source_hash: Option<String>SHA-256 hash of the source markdown files used to build this thesaurus. Used for cache invalidation: when the hash changes, the thesaurus is rebuilt.
Implementations§
Source§impl Thesaurus
impl Thesaurus
Sourcepub fn with_source_hash(self, hash: String) -> Self
pub fn with_source_hash(self, hash: String) -> Self
Set the source hash for cache invalidation tracking.
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<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
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?
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 UnsafeUnpin 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§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.