pub struct UncompressedPk(/* private fields */);Implementations§
Source§impl UncompressedPk
 
impl UncompressedPk
pub fn from_byte_array( data: [u8; 65], ) -> Result<UncompressedPk, InvalidPubkey<65>>
pub fn to_byte_array(&self) -> [u8; 65]
Methods from Deref<Target = PublicKey>§
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Sourcepub fn as_mut_ptr(&mut self) -> *mut PublicKey
 👎Deprecated since 0.25.0: Use Self::as_mut_c_ptr if you need to access the FFI layer
pub fn as_mut_ptr(&mut self) -> *mut PublicKey
Obtains a raw mutable pointer suitable for use with FFI functions.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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");Sourcepub 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§
Source§impl AsMut<<UncompressedPk as Wrapper>::Inner> for UncompressedPk
 
impl AsMut<<UncompressedPk as Wrapper>::Inner> for UncompressedPk
Source§impl AsRef<PublicKey> for UncompressedPk
 
impl AsRef<PublicKey> for UncompressedPk
Source§impl Borrow<PublicKey> for UncompressedPk
 
impl Borrow<PublicKey> for UncompressedPk
Source§impl BorrowMut<<UncompressedPk as Wrapper>::Inner> for UncompressedPk
 
impl BorrowMut<<UncompressedPk as Wrapper>::Inner> for UncompressedPk
Source§fn borrow_mut(&mut self) -> &mut <UncompressedPk as Wrapper>::Inner
 
fn borrow_mut(&mut self) -> &mut <UncompressedPk as Wrapper>::Inner
Source§impl Clone for UncompressedPk
 
impl Clone for UncompressedPk
Source§fn clone(&self) -> UncompressedPk
 
fn clone(&self) -> UncompressedPk
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UncompressedPk
 
impl Debug for UncompressedPk
Source§impl Decode for UncompressedPk
 
impl Decode for UncompressedPk
fn decode(reader: &mut impl Read) -> Result<UncompressedPk, DecodeError>
fn deserialize(bytes: impl AsRef<[u8]>) -> Result<Self, PsbtError>
Source§impl Deref for UncompressedPk
 
impl Deref for UncompressedPk
Source§impl DerefMut for UncompressedPk
 
impl DerefMut for UncompressedPk
Source§impl Display for UncompressedPk
 
impl Display for UncompressedPk
Source§impl Encode for UncompressedPk
 
impl Encode for UncompressedPk
Source§impl From<PublicKey> for UncompressedPk
 
impl From<PublicKey> for UncompressedPk
Source§fn from(v: PublicKey) -> UncompressedPk
 
fn from(v: PublicKey) -> UncompressedPk
Source§impl From<UncompressedPk> for LegacyPk
 
impl From<UncompressedPk> for LegacyPk
Source§fn from(pk: UncompressedPk) -> LegacyPk
 
fn from(pk: UncompressedPk) -> LegacyPk
Source§impl From<UncompressedPk> for PubkeyHash
 
impl From<UncompressedPk> for PubkeyHash
Source§fn from(pk: UncompressedPk) -> PubkeyHash
 
fn from(pk: UncompressedPk) -> PubkeyHash
Source§impl From<UncompressedPk> for PublicKey
 
impl From<UncompressedPk> for PublicKey
Source§fn from(wrapped: UncompressedPk) -> PublicKey
 
fn from(wrapped: UncompressedPk) -> PublicKey
Source§impl FromStr for UncompressedPk
 
impl FromStr for UncompressedPk
Source§type Err = PubkeyParseError<65>
 
type Err = PubkeyParseError<65>
Source§fn from_str(s: &str) -> Result<UncompressedPk, <UncompressedPk as FromStr>::Err>
 
fn from_str(s: &str) -> Result<UncompressedPk, <UncompressedPk as FromStr>::Err>
s to return a value of this type. Read moreSource§impl Hash for UncompressedPk
 
impl Hash for UncompressedPk
Source§impl LowerHex for UncompressedPk
 
impl LowerHex for UncompressedPk
Source§impl Ord for UncompressedPk
 
impl Ord for UncompressedPk
Source§fn cmp(&self, other: &UncompressedPk) -> Ordering
 
fn cmp(&self, other: &UncompressedPk) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Source§impl PartialEq for UncompressedPk
 
impl PartialEq for UncompressedPk
Source§impl PartialOrd for UncompressedPk
 
impl PartialOrd for UncompressedPk
Source§impl StrictDecode for UncompressedPk
 
impl StrictDecode for UncompressedPk
fn strict_decode( reader: &mut impl TypedRead, ) -> Result<UncompressedPk, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for UncompressedPk
 
impl StrictDumb for UncompressedPk
fn strict_dumb() -> UncompressedPk
Source§impl StrictEncode for UncompressedPk
 
impl StrictEncode for UncompressedPk
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
    W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictTuple for UncompressedPk
 
impl StrictTuple for UncompressedPk
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for UncompressedPk
 
impl StrictType for UncompressedPk
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
Source§impl Wrapper for UncompressedPk
 
impl Wrapper for UncompressedPk
Source§fn from_inner(inner: <UncompressedPk as Wrapper>::Inner) -> UncompressedPk
 
fn from_inner(inner: <UncompressedPk as Wrapper>::Inner) -> UncompressedPk
Source§fn as_inner(&self) -> &<UncompressedPk as Wrapper>::Inner
 
fn as_inner(&self) -> &<UncompressedPk as Wrapper>::Inner
Source§fn into_inner(self) -> <UncompressedPk as Wrapper>::Inner
 
fn into_inner(self) -> <UncompressedPk as Wrapper>::Inner
Source§impl WrapperMut for UncompressedPk
 
impl WrapperMut for UncompressedPk
Source§fn as_inner_mut(&mut self) -> &mut <UncompressedPk as Wrapper>::Inner
 
fn as_inner_mut(&mut self) -> &mut <UncompressedPk as Wrapper>::Inner
impl Copy for UncompressedPk
impl Eq for UncompressedPk
impl StrictProduct for UncompressedPk
impl StructuralPartialEq for UncompressedPk
Auto Trait Implementations§
impl Freeze for UncompressedPk
impl RefUnwindSafe for UncompressedPk
impl Send for UncompressedPk
impl Sync for UncompressedPk
impl Unpin for UncompressedPk
impl UnwindSafe for UncompressedPk
Blanket Implementations§
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,
Source§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§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.