Enum Parity
pub enum Parity {
Eip155(u64),
NonEip155(bool),
Parity(bool),
}
Expand description
The parity of the signature, stored as either a V value (which may include a chain id), or the y-parity.
Variants§
Eip155(u64)
Explicit V value. May be EIP-155 modified.
NonEip155(bool)
Non-EIP155. 27 or 28.
Parity(bool)
Parity flag. True for odd.
Implementations§
§impl Parity
impl Parity
pub const fn y_parity_byte(&self) -> u8
pub const fn y_parity_byte(&self) -> u8
Return the y-parity as 0 or 1
pub const fn y_parity_byte_non_eip155(&self) -> Option<u8>
pub const fn y_parity_byte_non_eip155(&self) -> Option<u8>
Return the y-parity byte as 27 or 28, in the case of a non-EIP155 signature.
pub const fn strip_chain_id(&self) -> Parity
pub const fn strip_chain_id(&self) -> Parity
Converts an EIP-155 V value to a non-EIP-155 V value.
This is a nop for non-EIP-155 values.
pub const fn with_chain_id(self, chain_id: u64) -> Parity
pub const fn with_chain_id(self, chain_id: u64) -> Parity
Applies EIP-155 with the given chain ID.
pub const fn recid(&self) -> RecoveryId
pub const fn recid(&self) -> RecoveryId
Determines the recovery ID.
pub const fn to_parity_bool(self) -> Parity
pub const fn to_parity_bool(self) -> Parity
Convert to a parity bool, dropping any V information.
Trait Implementations§
impl Copy for Parity
impl Eq for Parity
impl StructuralPartialEq for Parity
Auto Trait Implementations§
impl Freeze for Parity
impl RefUnwindSafe for Parity
impl Send for Parity
impl Sync for Parity
impl Unpin for Parity
impl UnwindSafe for Parity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more