pub enum Parity {
Even,
Odd,
}
Expand description
Represents the parity passed between FFI function calls.
Variants
Even
Even parity.
Odd
Odd parity.
Implementations
sourceimpl Parity
impl Parity
sourcepub fn to_u8(self) -> u8
pub fn to_u8(self) -> u8
Converts parity into an integer (byte) value.
This returns 0
for even parity and 1
for odd parity.
sourcepub fn to_i32(self) -> i32
pub fn to_i32(self) -> i32
Converts parity into an integer value.
This returns 0
for even parity and 1
for odd parity.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Parity
Available on crate feature serde
only.
impl<'de> Deserialize<'de> for Parity
serde
only.The parity is deserialized as u8
- 0
for even, 1
for odd.
sourcefn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for Parity
impl Ord for Parity
sourceimpl PartialOrd<Parity> for Parity
impl PartialOrd<Parity> for Parity
sourcefn partial_cmp(&self, other: &Parity) -> Option<Ordering>
fn partial_cmp(&self, other: &Parity) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Serialize for Parity
Available on crate feature serde
only.
impl Serialize for Parity
serde
only.The parity is serialized as u8
- 0
for even, 1
for odd.
impl Copy for Parity
impl Eq for Parity
impl StructuralEq for Parity
impl StructuralPartialEq for Parity
Auto Trait Implementations
impl RefUnwindSafe for Parity
impl Send for Parity
impl Sync for Parity
impl Unpin for Parity
impl UnwindSafe for Parity
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more