pub enum Gender {
Male,
Female,
Unknown,
}Expand description
Gender of a candidate.
Variants§
Implementations§
Source§impl Gender
impl Gender
Sourcepub fn new(s: impl AsRef<str>) -> Result<Self, EMLError>
pub fn new(s: impl AsRef<str>) -> Result<Self, EMLError>
Create a new Gender from a string, validating its format.
Sourcepub fn from_eml_value(s: impl AsRef<str>) -> Result<Self, UnknownGenderError>
pub fn from_eml_value(s: impl AsRef<str>) -> Result<Self, UnknownGenderError>
Create a Gender from a &str, if possible.
Sourcepub fn to_eml_value(&self) -> &'static str
pub fn to_eml_value(&self) -> &'static str
Get the &str representation of this Gender.
Trait Implementations§
Source§impl StringValueData for Gender
impl StringValueData for Gender
Source§type Error = UnknownGenderError
type Error = UnknownGenderError
The error type returned when parsing the value from a string fails.
Source§fn parse_from_str(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
fn parse_from_str(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
Parse the value from a string.
Source§fn to_raw_value(&self) -> String
fn to_raw_value(&self) -> String
Convert the value to its raw string representation.
impl Copy for Gender
impl Eq for Gender
impl StructuralPartialEq for Gender
Auto Trait Implementations§
impl Freeze for Gender
impl RefUnwindSafe for Gender
impl Send for Gender
impl Sync for Gender
impl Unpin for Gender
impl UnsafeUnpin for Gender
impl UnwindSafe for Gender
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