pub struct NHI(/* private fields */);
Expand description
Represents a valid NHI number that satisfies the HISO 10046:2023 standard.
Implementations§
Source§impl NHI
impl NHI
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Extracts a string slice containing this NHI number’s underlying string value
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Converts this NHI to its underlying String value
Sourcepub fn is_test(&self) -> bool
pub fn is_test(&self) -> bool
Returns true
if this NHI is reserved for testing and false
otherwise
Sourcepub fn is_not_test(&self) -> bool
pub fn is_not_test(&self) -> bool
Returns true
if this NHI is NOT reserved for testing and false
otherwise
Trait Implementations§
Source§impl FromStr for NHI
impl FromStr for NHI
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses a string to an NHI iff the given string satisfies the HISO 10046:2023 standard, otherwise returns an error.
§Arguments
s
: a potential NHI string
returns: Result<NHI, ParseNHIError>
§Examples
use nhi::NHI;
use std::str::FromStr;
let nhi = NHI::from_str("zbn77vl").unwrap();
assert_eq!(nhi.as_str(), "ZBN77VL")
Source§type Err = ParseNhiError
type Err = ParseNhiError
The associated error which can be returned from parsing.
Source§impl Ord for NHI
impl Ord for NHI
Source§impl PartialOrd for NHI
impl PartialOrd for NHI
impl Eq for NHI
impl StructuralPartialEq for NHI
Auto Trait Implementations§
impl Freeze for NHI
impl RefUnwindSafe for NHI
impl Send for NHI
impl Sync for NHI
impl Unpin for NHI
impl UnwindSafe for NHI
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