pub trait EncodableSignature: Sized {
Show 13 methods
// Required methods
fn from_rs_and_parity<P: TryInto<Parity, Error = E>, E: Into<SignatureError>>(
r: U256,
s: U256,
parity: P,
) -> Result<Self, SignatureError>;
fn r(&self) -> U256;
fn s(&self) -> U256;
fn v(&self) -> Parity;
fn with_parity<T: Into<Parity>>(self, parity: T) -> Self;
// Provided methods
fn with_chain_id(self, chain_id: u64) -> Self
where Self: Copy { ... }
fn with_parity_bool(self) -> Self
where Self: Copy { ... }
fn decode_rlp_vrs(buf: &mut &[u8]) -> Result<Self, Error> { ... }
fn rlp_rs_len(&self) -> usize { ... }
fn rlp_vrs_len(&self) -> usize { ... }
fn write_rlp_rs(&self, out: &mut dyn BufMut) { ... }
fn write_rlp_v(&self, out: &mut dyn BufMut) { ... }
fn write_rlp_vrs(&self, out: &mut dyn BufMut) { ... }
}
Expand description
Helper trait used to streamline signatures encoding.
Required Methods§
sourcefn from_rs_and_parity<P: TryInto<Parity, Error = E>, E: Into<SignatureError>>(
r: U256,
s: U256,
parity: P,
) -> Result<Self, SignatureError>
fn from_rs_and_parity<P: TryInto<Parity, Error = E>, E: Into<SignatureError>>( r: U256, s: U256, parity: P, ) -> Result<Self, SignatureError>
Instantiate from v, r, s.
sourcefn with_parity<T: Into<Parity>>(self, parity: T) -> Self
fn with_parity<T: Into<Parity>>(self, parity: T) -> Self
Sets the recovery ID by normalizing a v
value.
Provided Methods§
sourcefn with_chain_id(self, chain_id: u64) -> Selfwhere
Self: Copy,
fn with_chain_id(self, chain_id: u64) -> Selfwhere
Self: Copy,
Modifies the recovery ID by applying EIP-155 to a v
value.
sourcefn with_parity_bool(self) -> Selfwhere
Self: Copy,
fn with_parity_bool(self) -> Selfwhere
Self: Copy,
Modifies the recovery ID by dropping any [EIP-155] v value, converting to a simple parity bool.
sourcefn decode_rlp_vrs(buf: &mut &[u8]) -> Result<Self, Error>
fn decode_rlp_vrs(buf: &mut &[u8]) -> Result<Self, Error>
Decode an RLP-encoded VRS signature.
sourcefn rlp_rs_len(&self) -> usize
fn rlp_rs_len(&self) -> usize
Length of RLP RS field encoding
sourcefn rlp_vrs_len(&self) -> usize
fn rlp_vrs_len(&self) -> usize
Length of RLP V field encoding
sourcefn write_rlp_rs(&self, out: &mut dyn BufMut)
fn write_rlp_rs(&self, out: &mut dyn BufMut)
Write R and S to an RLP buffer in progress.
sourcefn write_rlp_v(&self, out: &mut dyn BufMut)
fn write_rlp_v(&self, out: &mut dyn BufMut)
Write the V to an RLP buffer without using EIP-155.
sourcefn write_rlp_vrs(&self, out: &mut dyn BufMut)
fn write_rlp_vrs(&self, out: &mut dyn BufMut)
Write the VRS to the output. The V will always be 27 or 28.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.