pub struct InputSignatureRef<'a>(/* private fields */);Expand description
A borrowed equivalent of the InputSignature data type.
It can be useful for checking incoming signatures from unauthorized sources.
§Examples
use secp256k1::Secp256k1;
use btc_transaction_utils::InputSignatureRef;
// Get a signature from the unknown source.
let bytes = hex::decode(
"304402201538279618a4626653775069b43d4315c7d2ff3000\
8d339d0ed31ff41e628e71022028f3182fc39df28201ca4d7d\
489aece7bc5bc6bfe05b09b6a9d3b70bf5f3743101",
).unwrap();
// Try to decode it.
let signature = InputSignatureRef::from_bytes(&bytes)
.expect("Signature should be correct");Implementations§
Source§impl<'a> InputSignatureRef<'a>
impl<'a> InputSignatureRef<'a>
Sourcepub fn from_bytes(bytes: &'a [u8]) -> Result<InputSignatureRef<'a>, Error>
pub fn from_bytes(bytes: &'a [u8]) -> Result<InputSignatureRef<'a>, Error>
Tries to construct input signature from the raw bytes.
Sourcepub fn sighash_type(&self) -> SigHashType
pub fn sighash_type(&self) -> SigHashType
Returns a sighash type of the given input signature.
Trait Implementations§
Source§impl<'a> AsRef<[u8]> for InputSignatureRef<'a>
impl<'a> AsRef<[u8]> for InputSignatureRef<'a>
Source§impl<'a> Clone for InputSignatureRef<'a>
impl<'a> Clone for InputSignatureRef<'a>
Source§fn clone(&self) -> InputSignatureRef<'a>
fn clone(&self) -> InputSignatureRef<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for InputSignatureRef<'a>
Source§impl<'a> Debug for InputSignatureRef<'a>
impl<'a> Debug for InputSignatureRef<'a>
Source§impl<'a> From<&'a InputSignature> for InputSignatureRef<'a>
impl<'a> From<&'a InputSignature> for InputSignatureRef<'a>
Source§fn from(s: &'a InputSignature) -> InputSignatureRef<'_>
fn from(s: &'a InputSignature) -> InputSignatureRef<'_>
Converts to this type from the input type.
Source§impl<'a> From<InputSignatureRef<'a>> for InputSignature
impl<'a> From<InputSignatureRef<'a>> for InputSignature
Source§fn from(s: InputSignatureRef<'a>) -> InputSignature
fn from(s: InputSignatureRef<'a>) -> InputSignature
Converts to this type from the input type.
Source§impl<'a> PartialEq for InputSignatureRef<'a>
impl<'a> PartialEq for InputSignatureRef<'a>
Source§fn eq(&self, other: &InputSignatureRef<'a>) -> bool
fn eq(&self, other: &InputSignatureRef<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for InputSignatureRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for InputSignatureRef<'a>
impl<'a> RefUnwindSafe for InputSignatureRef<'a>
impl<'a> Send for InputSignatureRef<'a>
impl<'a> Sync for InputSignatureRef<'a>
impl<'a> Unpin for InputSignatureRef<'a>
impl<'a> UnsafeUnpin for InputSignatureRef<'a>
impl<'a> UnwindSafe for InputSignatureRef<'a>
Blanket Implementations§
Source§impl<T> Base32Len for T
impl<T> Base32Len for T
Source§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
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<'f, T> CheckBase32<Vec<u5>> for T
impl<'f, T> CheckBase32<Vec<u5>> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToBase32 for T
impl<T> ToBase32 for T
Source§fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err>where
W: WriteBase32,
fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err>where
W: WriteBase32,
Encode as base32 and write it to the supplied writer
Implementations shouldn’t allocate.
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)