[−][src]Struct btc_transaction_utils::InputSignatureRef
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");
Methods
impl<'a> InputSignatureRef<'a>
[src]
pub fn from_bytes(bytes: &'a [u8]) -> Result<InputSignatureRef<'a>, Error>
[src]
Tries to construct input signature from the raw bytes.
pub fn content(&self) -> &[u8]
[src]
Returns the signature content in canonical form.
pub fn sighash_type(&self) -> SigHashType
[src]
Returns a sighash type of the given input signature.
Trait Implementations
impl<'a> AsRef<[u8]> for InputSignatureRef<'a>
[src]
impl<'a> Clone for InputSignatureRef<'a>
[src]
fn clone(&self) -> InputSignatureRef<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Copy for InputSignatureRef<'a>
[src]
impl<'a> Debug for InputSignatureRef<'a>
[src]
impl<'a> From<&'a InputSignature> for InputSignatureRef<'a>
[src]
fn from(s: &'a InputSignature) -> InputSignatureRef
[src]
impl<'a> From<InputSignatureRef<'a>> for Vec<u8>
[src]
fn from(s: InputSignatureRef<'a>) -> Vec<u8>
[src]
impl<'a> From<InputSignatureRef<'a>> for InputSignature
[src]
fn from(s: InputSignatureRef<'a>) -> InputSignature
[src]
impl<'a> PartialEq<InputSignatureRef<'a>> for InputSignatureRef<'a>
[src]
fn eq(&self, other: &InputSignatureRef<'a>) -> bool
[src]
fn ne(&self, other: &InputSignatureRef<'a>) -> bool
[src]
impl<'a> StructuralPartialEq for InputSignatureRef<'a>
[src]
Auto Trait Implementations
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> UnwindSafe for InputSignatureRef<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Base32Len for T where
T: AsRef<[u8]>,
T: AsRef<[u8]>,
fn base32_len(&self) -> usize
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'f, T> CheckBase32<Vec<u5>> for T where
T: AsRef<[u8]>,
T: AsRef<[u8]>,
type Err = Error
Error type if conversion fails
fn check_base32(self) -> Result<Vec<u5>, <T as CheckBase32<Vec<u5>>>::Err>
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToBase32 for T where
T: AsRef<[u8]>,
T: AsRef<[u8]>,
fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
W: WriteBase32,
fn to_base32(&self) -> Vec<u5>
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,