pub enum DescriptorKey {
Compressed([u8; 33]),
XOnly([u8; 32]),
}Expand description
A public key for use in descriptors.
Variants§
Compressed([u8; 33])
A compressed public key (33 bytes).
XOnly([u8; 32])
An x-only public key (32 bytes, for Taproot).
Implementations§
Source§impl DescriptorKey
impl DescriptorKey
Sourcepub fn from_hex(hex_str: &str) -> Result<Self, SignerError>
pub fn from_hex(hex_str: &str) -> Result<Self, SignerError>
Parse a hex-encoded public key.
Sourcepub fn compressed_bytes(&self) -> Option<&[u8; 33]>
pub fn compressed_bytes(&self) -> Option<&[u8; 33]>
Get the compressed public key bytes.
Sourcepub fn x_only_bytes(&self) -> Option<&[u8; 32]>
pub fn x_only_bytes(&self) -> Option<&[u8; 32]>
Get the x-only key bytes.
Trait Implementations§
Source§impl Clone for DescriptorKey
impl Clone for DescriptorKey
Source§fn clone(&self) -> DescriptorKey
fn clone(&self) -> DescriptorKey
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 moreSource§impl Debug for DescriptorKey
impl Debug for DescriptorKey
Source§impl PartialEq for DescriptorKey
impl PartialEq for DescriptorKey
impl Eq for DescriptorKey
impl StructuralPartialEq for DescriptorKey
Auto Trait Implementations§
impl Freeze for DescriptorKey
impl RefUnwindSafe for DescriptorKey
impl Send for DescriptorKey
impl Sync for DescriptorKey
impl Unpin for DescriptorKey
impl UnsafeUnpin for DescriptorKey
impl UnwindSafe for DescriptorKey
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
Mutably borrows from an owned value. Read more