pub struct Definition {
pub name: String,
pub definition: String,
pub kind: DefinitionKind,
}Expand description
A single entry from the GNU units definitions database.
Fields§
§name: StringThe name of the unit, prefix, function, table, or alias.
definition: StringThe definition string for this entry.
kind: DefinitionKindWhat kind of definition this is.
Implementations§
Source§impl Definition
impl Definition
Sourcepub fn canonical_name(&self) -> &str
pub fn canonical_name(&self) -> &str
Returns the canonical lookup name used by the C library for deduplication.
The C library normalizes names before hash-table lookup:
- Prefixes: trailing
-is removed (kilo-→kilo) - Functions: everything from
(onward is stripped (tempC(x)→tempC) - Tables: everything from
[onward is stripped (gasmark[degR]→gasmark) - Units and aliases: the full name is used as-is
Trait Implementations§
Source§impl Clone for Definition
impl Clone for Definition
Source§fn clone(&self) -> Definition
fn clone(&self) -> Definition
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 Definition
impl Debug for Definition
Source§impl Ord for Definition
impl Ord for Definition
1.21.0 (const: unstable) · 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 Definition
impl PartialEq for Definition
Source§impl PartialOrd for Definition
impl PartialOrd for Definition
impl Eq for Definition
Auto Trait Implementations§
impl Freeze for Definition
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin for Definition
impl UnsafeUnpin for Definition
impl UnwindSafe for Definition
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