Struct PayeePubKey  
pub struct PayeePubKey(pub PublicKey);Expand description
Payee public key
Tuple Fields§
§0: PublicKeyMethods from Deref<Target = PublicKey>§
pub fn as_ptr(&self) -> *const PublicKey
pub fn as_ptr(&self) -> *const PublicKey
Obtains a raw const pointer suitable for use with FFI functions.
pub fn serialize(&self) -> [u8; 33]
pub fn serialize(&self) -> [u8; 33]
Serializes the key as a byte-encoded pair of values. In compressed form the y-coordinate is represented by only a single bit, as x determines it up to one bit.
pub fn serialize_uncompressed(&self) -> [u8; 65]
pub fn serialize_uncompressed(&self) -> [u8; 65]
Serializes the key as a byte-encoded pair of values, in uncompressed form.
pub fn combine(&self, other: &PublicKey) -> Result<PublicKey, Error>
pub fn combine(&self, other: &PublicKey) -> Result<PublicKey, Error>
Adds a second key to this one, returning the sum.
§Errors
If the result would be the point at infinity, i.e. adding this point to its own negation.
§Examples
use secp256k1::{rand, Secp256k1};
let secp = Secp256k1::new();
let mut rng = rand::thread_rng();
let (_, pk1) = secp.generate_keypair(&mut rng);
let (_, pk2) = secp.generate_keypair(&mut rng);
let sum = pk1.combine(&pk2).expect("It's improbable to fail for 2 random public keys");pub fn x_only_public_key(&self) -> (XOnlyPublicKey, Parity)
pub fn x_only_public_key(&self) -> (XOnlyPublicKey, Parity)
Returns the [XOnlyPublicKey] (and it’s [Parity]) for this [PublicKey].
Trait Implementations§
§impl Base32Len for PayeePubKey
 
impl Base32Len for PayeePubKey
§fn base32_len(&self) -> usize
 
fn base32_len(&self) -> usize
Calculate the base32 serialized length
§impl Clone for PayeePubKey
 
impl Clone for PayeePubKey
§fn clone(&self) -> PayeePubKey
 
fn clone(&self) -> PayeePubKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read more§impl Debug for PayeePubKey
 
impl Debug for PayeePubKey
§impl From<PublicKey> for PayeePubKey
 
impl From<PublicKey> for PayeePubKey
§fn from(pk: PublicKey) -> PayeePubKey
 
fn from(pk: PublicKey) -> PayeePubKey
Converts to this type from the input type.
§impl FromBase32 for PayeePubKey
 
impl FromBase32 for PayeePubKey
§type Err = Bolt11ParseError
 
type Err = Bolt11ParseError
The associated error which can be returned from parsing (e.g. because of bad padding).
§fn from_base32(field_data: &[u5]) -> Result<PayeePubKey, Bolt11ParseError>
 
fn from_base32(field_data: &[u5]) -> Result<PayeePubKey, Bolt11ParseError>
Convert a base32 slice to 
Self.§impl Hash for PayeePubKey
 
impl Hash for PayeePubKey
§impl Ord for PayeePubKey
 
impl Ord for PayeePubKey
§impl PartialEq for PayeePubKey
 
impl PartialEq for PayeePubKey
§impl PartialOrd for PayeePubKey
 
impl PartialOrd for PayeePubKey
§impl ToBase32 for PayeePubKey
 
impl ToBase32 for PayeePubKey
§impl Deref for PayeePubKey
 
impl Deref for PayeePubKey
impl Eq for PayeePubKey
impl StructuralPartialEq for PayeePubKey
Auto Trait Implementations§
impl Freeze for PayeePubKey
impl RefUnwindSafe for PayeePubKey
impl Send for PayeePubKey
impl Sync for PayeePubKey
impl Unpin for PayeePubKey
impl UnwindSafe for PayeePubKey
Blanket Implementations§
§impl<T> AnyEq for T
 
impl<T> AnyEq for T
§impl<T> AnySync for T
 
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
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,
§impl<Q, K> Comparable<K> for Q
 
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to 
key and return true if they are equal.§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
§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
Compare self to 
key and return true if they are equal.§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
§impl<T> Instrument for T
 
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
 
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
Converts 
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> ⓘ
Converts 
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 moreSource§impl<T> IntoRequest<T> for T
 
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
 
fn into_request(self) -> Request<T>
Wrap the input message 
T in a tonic::Request