pub struct GlossaryTerm {
pub id: String,
pub term: String,
pub definition: String,
pub aliases: Vec<String>,
pub see_also: Vec<String>,
pub category: Option<String>,
pub pronunciation: Option<String>,
pub etymology: Option<String>,
pub usage: Option<String>,
}Expand description
A glossary term definition.
Fields§
§id: StringUnique identifier.
term: StringThe term being defined.
definition: StringDefinition text.
aliases: Vec<String>Alternative forms or spellings.
see_also: Vec<String>Related terms (by ID).
category: Option<String>Category or subject area.
pronunciation: Option<String>Pronunciation guide.
etymology: Option<String>Etymology or origin.
usage: Option<String>Usage notes.
Implementations§
Source§impl GlossaryTerm
impl GlossaryTerm
Sourcepub fn new(
id: impl Into<String>,
term: impl Into<String>,
definition: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, term: impl Into<String>, definition: impl Into<String>, ) -> Self
Create a new glossary term.
Sourcepub fn with_alias(self, alias: impl Into<String>) -> Self
pub fn with_alias(self, alias: impl Into<String>) -> Self
Add an alias.
Sourcepub fn with_see_also(self, term_id: impl Into<String>) -> Self
pub fn with_see_also(self, term_id: impl Into<String>) -> Self
Add a “see also” reference.
Sourcepub fn with_category(self, category: impl Into<String>) -> Self
pub fn with_category(self, category: impl Into<String>) -> Self
Set category.
Sourcepub fn with_pronunciation(self, pronunciation: impl Into<String>) -> Self
pub fn with_pronunciation(self, pronunciation: impl Into<String>) -> Self
Set pronunciation.
Trait Implementations§
Source§impl Clone for GlossaryTerm
impl Clone for GlossaryTerm
Source§fn clone(&self) -> GlossaryTerm
fn clone(&self) -> GlossaryTerm
Returns a duplicate of the value. Read more
1.0.0 · 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 GlossaryTerm
impl Debug for GlossaryTerm
Source§impl<'de> Deserialize<'de> for GlossaryTerm
impl<'de> Deserialize<'de> for GlossaryTerm
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 PartialEq for GlossaryTerm
impl PartialEq for GlossaryTerm
Source§impl Serialize for GlossaryTerm
impl Serialize for GlossaryTerm
impl Eq for GlossaryTerm
impl StructuralPartialEq for GlossaryTerm
Auto Trait Implementations§
impl Freeze for GlossaryTerm
impl RefUnwindSafe for GlossaryTerm
impl Send for GlossaryTerm
impl Sync for GlossaryTerm
impl Unpin for GlossaryTerm
impl UnsafeUnpin for GlossaryTerm
impl UnwindSafe for GlossaryTerm
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.