pub enum SignatureMessage {
TransactionHash,
Explicit(FixedBytes<32>),
}Expand description
The message authorized by an EIP-8141 signature entry.
RLP encodes the transaction hash case as an empty byte string and an explicit digest as its 32
bytes, preserving the EIP-8141 wire format. Decoding rejects other lengths and the reserved
zero digest. JSON uses hex byte strings, including "0x" for the transaction hash case; null
also deserializes as the transaction hash.
Variants§
TransactionHash
The signature signs the canonical transaction signature hash.
Explicit(FixedBytes<32>)
The signature signs an explicit non-zero 32-byte digest.
Use Self::explicit to reject the reserved zero digest.
Implementations§
Source§impl SignatureMessage
impl SignatureMessage
Sourcepub const fn is_explicit(self) -> bool
pub const fn is_explicit(self) -> bool
Returns true if this is Self::Explicit.
Sourcepub fn explicit(
digest: FixedBytes<32>,
) -> Result<SignatureMessage, Eip8141Error>
pub fn explicit( digest: FixedBytes<32>, ) -> Result<SignatureMessage, Eip8141Error>
Creates an explicit message, rejecting the reserved zero digest.
Sourcepub const fn is_transaction_hash(self) -> bool
pub const fn is_transaction_hash(self) -> bool
Returns true if the signature signs the canonical transaction signature hash.
Sourcepub const fn digest(self) -> Option<FixedBytes<32>>
pub const fn digest(self) -> Option<FixedBytes<32>>
Returns the explicit digest, or None for the transaction hash case.
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for SignatureMessage
Available on crate feature arbitrary only.
impl<'a> Arbitrary<'a> for SignatureMessage
arbitrary only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<SignatureMessage, Error>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<SignatureMessage, Error>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl BorshDeserialize for SignatureMessage
impl BorshDeserialize for SignatureMessage
fn deserialize_reader<__R>(reader: &mut __R) -> Result<SignatureMessage, Error>where
__R: Read,
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for SignatureMessage
impl BorshSerialize for SignatureMessage
Source§impl Clone for SignatureMessage
impl Clone for SignatureMessage
Source§fn clone(&self) -> SignatureMessage
fn clone(&self) -> SignatureMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SignatureMessage
Source§impl Debug for SignatureMessage
impl Debug for SignatureMessage
Source§impl Decodable for SignatureMessage
impl Decodable for SignatureMessage
Source§impl Default for SignatureMessage
impl Default for SignatureMessage
Source§fn default() -> SignatureMessage
fn default() -> SignatureMessage
Source§impl<'de> Deserialize<'de> for SignatureMessage
Available on crate feature serde only.
impl<'de> Deserialize<'de> for SignatureMessage
serde only.Source§fn deserialize<D>(
deserializer: D,
) -> Result<SignatureMessage, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SignatureMessage, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Encodable for SignatureMessage
impl Encodable for SignatureMessage
Source§impl EnumExt for SignatureMessage
impl EnumExt for SignatureMessage
Source§fn deserialize_variant<__R>(
reader: &mut __R,
variant_tag: u8,
) -> Result<SignatureMessage, Error>where
__R: Read,
fn deserialize_variant<__R>(
reader: &mut __R,
variant_tag: u8,
) -> Result<SignatureMessage, Error>where
__R: Read,
impl Eq for SignatureMessage
Source§impl Hash for SignatureMessage
impl Hash for SignatureMessage
Source§impl PartialEq for SignatureMessage
impl PartialEq for SignatureMessage
Source§impl Serialize for SignatureMessage
Available on crate feature serde only.
impl Serialize for SignatureMessage
serde only.Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for SignatureMessage
Source§impl TryFrom<&[u8]> for SignatureMessage
impl TryFrom<&[u8]> for SignatureMessage
Source§type Error = Eip8141Error
type Error = Eip8141Error
Source§fn try_from(
value: &[u8],
) -> Result<SignatureMessage, <SignatureMessage as TryFrom<&[u8]>>::Error>
fn try_from( value: &[u8], ) -> Result<SignatureMessage, <SignatureMessage as TryFrom<&[u8]>>::Error>
Auto Trait Implementations§
impl Freeze for SignatureMessage
impl RefUnwindSafe for SignatureMessage
impl Send for SignatureMessage
impl Sync for SignatureMessage
impl Unpin for SignatureMessage
impl UnsafeUnpin for SignatureMessage
impl UnwindSafe for SignatureMessage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 33 bytes
Size for each variant:
TransactionHash: 0 bytesExplicit: 32 bytes