pub struct NormalizedTerm {
pub id: u64,
pub value: NormalizedTermValue,
pub display_value: Option<String>,
pub url: Option<String>,
}Expand description
A normalized term is a higher-level term that has been normalized
It holds a unique identifier to an underlying and the normalized value.
The display_value field stores the original case for output purposes.
Fields§
§id: u64Unique identifier for the normalized term
value: NormalizedTermValueThe normalized value (lowercase, used for case-insensitive matching)
display_value: Option<String>The display value with original case preserved (used for replacement output)
Falls back to value if None for backward compatibility
url: Option<String>The URL of the normalized term
Implementations§
Source§impl NormalizedTerm
impl NormalizedTerm
Sourcepub fn new(id: u64, value: NormalizedTermValue) -> Self
pub fn new(id: u64, value: NormalizedTermValue) -> Self
Create a new normalized term with the given id and value. The display_value will be None (falls back to value for output).
Sourcepub fn with_display_value(self, display_value: String) -> Self
pub fn with_display_value(self, display_value: String) -> Self
Set the display value (original case for output). Use this to preserve the original case from markdown headings.
Trait Implementations§
Source§impl Clone for NormalizedTerm
impl Clone for NormalizedTerm
Source§fn clone(&self) -> NormalizedTerm
fn clone(&self) -> NormalizedTerm
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 NormalizedTerm
impl Debug for NormalizedTerm
Source§impl<'de> Deserialize<'de> for NormalizedTerm
impl<'de> Deserialize<'de> for NormalizedTerm
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 Ord for NormalizedTerm
impl Ord for NormalizedTerm
Source§fn cmp(&self, other: &NormalizedTerm) -> Ordering
fn cmp(&self, other: &NormalizedTerm) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NormalizedTerm
impl PartialEq for NormalizedTerm
Source§impl PartialOrd for NormalizedTerm
impl PartialOrd for NormalizedTerm
Source§impl Serialize for NormalizedTerm
impl Serialize for NormalizedTerm
impl Eq for NormalizedTerm
impl StructuralPartialEq for NormalizedTerm
Auto Trait Implementations§
impl Freeze for NormalizedTerm
impl RefUnwindSafe for NormalizedTerm
impl Send for NormalizedTerm
impl Sync for NormalizedTerm
impl Unpin for NormalizedTerm
impl UnwindSafe for NormalizedTerm
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