Struct PayeePubKey
pub struct PayeePubKey(pub PublicKey);Expand description
Payee public key
Tuple Fields§
§0: PublicKeyMethods from Deref<Target = PublicKey>§
pub fn cmp_fast_unstable(&self, other: &PublicKey) -> Ordering
pub fn cmp_fast_unstable(&self, other: &PublicKey) -> Ordering
Like cmp::Cmp but faster and with no guarantees across library versions.
The Cmp implementation for FFI types is stable but slow because it first
serializes self and other before comparing them. This function provides a faster
comparison if you know that your types come from the same library version.
pub fn eq_fast_unstable(&self, other: &PublicKey) -> bool
pub fn eq_fast_unstable(&self, other: &PublicKey) -> bool
Like cmp::Eq but faster and with no guarantees across library versions.
The Eq implementation for FFI types is stable but slow because it first serializes
self and other before comparing them. This function provides a faster equality
check if you know that your types come from the same library version.
pub fn as_ptr(&self) -> *const PublicKey
👎Deprecated since 0.25.0: Use Self::as_c_ptr if you need to access the FFI layer
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
§impl Clone for PayeePubKey
impl Clone for PayeePubKey
§fn clone(&self) -> PayeePubKey
fn clone(&self) -> PayeePubKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for PayeePubKey
impl Debug for PayeePubKey
§impl Deref for PayeePubKey
impl Deref for PayeePubKey
§impl From<PublicKey> for PayeePubKey
impl From<PublicKey> for PayeePubKey
§fn from(pk: PublicKey) -> PayeePubKey
fn from(pk: PublicKey) -> PayeePubKey
§impl FromBase32 for PayeePubKey
impl FromBase32 for PayeePubKey
§type Err = Bolt11ParseError
type Err = Bolt11ParseError
§fn from_base32(field_data: &[u5]) -> Result<PayeePubKey, Bolt11ParseError>
fn from_base32(field_data: &[u5]) -> Result<PayeePubKey, Bolt11ParseError>
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
§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,
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> 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
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
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any.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
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
§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
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
§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
§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> ⓘ
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 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>
T in a tonic::Request