Struct personify::PersonaData [−][src]
A struct with the parsed data of a Persona ID.
Persona data can be parsed from a string using their std::str::FromStr
implementation, like so:
ⓘ
let v = "A-223-0-QZ-029"; assert_eq!( v.parse::<PersonaData>().unwrap(), PersonaData { model: MT::Alpha, date: chrono::NaiveDate::from_ymd(2223, 1, 1), personality: "QZ".into(), manufacture_no: 29, } );
They can also be re-stringified using std::fmt::Display
.
ⓘ
assert_eq!( format!( "{}", PersonaData { model: MT::Alpha, date: chrono::NaiveDate::from_ymd(2223, 1, 1), personality: "QZ".into(), manufacture_no: 29, } ), "A-223-0-QZ-029" );
Fields
model: ModelType
date: NaiveDate
personality: [char; 2]
manufacture_no: u16
Trait Implementations
impl Debug for PersonaData
[src]
impl Display for PersonaData
[src]
impl Eq for PersonaData
[src]
impl FromStr for PersonaData
[src]
type Err = ParseFailure
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl PartialEq<PersonaData> for PersonaData
[src]
fn eq(&self, other: &PersonaData) -> bool
[src]
fn ne(&self, other: &PersonaData) -> bool
[src]
impl StructuralEq for PersonaData
[src]
impl StructuralPartialEq for PersonaData
[src]
Auto Trait Implementations
impl RefUnwindSafe for PersonaData
impl Send for PersonaData
impl Sync for PersonaData
impl Unpin for PersonaData
impl UnwindSafe for PersonaData
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,