pub enum Parity {
Even,
Odd,
}
Expand description
Represents the parity passed between FFI function calls.
Variants§
Implementations§
source§impl 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§
source§impl<'de> Deserialize<'de> for Parity
Available on crate feature serde
only.
impl<'de> Deserialize<'de> for Parity
Available on crate feature
serde
only.The parity is deserialized as u8
- 0
for even, 1
for odd.
source§fn 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
source§impl Ord for Parity
impl Ord for Parity
source§impl PartialOrd<Parity> for Parity
impl PartialOrd<Parity> for Parity
1.0.0 · source§fn 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 moresource§impl Serialize for Parity
Available on crate feature serde
only.
impl Serialize for Parity
Available on crate feature
serde
only.The parity is serialized as u8
- 0
for even, 1
for odd.