Struct psbt::ProprietaryKey
source · pub struct ProprietaryKey<Subtype = u8>where
Subtype: Copy + From<u8> + Into<u8>,{
pub prefix: Vec<u8, Global>,
pub subtype: Subtype,
pub key: Vec<u8, Global>,
}
Expand description
Proprietary keys (i.e. keys starting with 0xFC byte) with their internal structure according to BIP 174.
Fields§
§prefix: Vec<u8, Global>
Proprietary type prefix used for grouping together keys under some application and avoid namespace collision
subtype: Subtype
Custom proprietary subtype
key: Vec<u8, Global>
Additional key bytes (like serialized public key data etc)
Implementations§
source§impl<Subtype> ProprietaryKey<Subtype>where
Subtype: Copy + From<u8> + Into<u8>,
impl<Subtype> ProprietaryKey<Subtype>where
Subtype: Copy + From<u8> + Into<u8>,
sourcepub fn from_key(key: Key) -> Result<ProprietaryKey<Subtype>, Error>
👎Deprecated since 0.29.0: use try_from instead
pub fn from_key(key: Key) -> Result<ProprietaryKey<Subtype>, Error>
Constructs ProprietaryKey from Key; returns
Error::InvalidProprietaryKey if key
do not starts with 0xFC byte
Trait Implementations§
source§impl<Subtype> Clone for ProprietaryKey<Subtype>where
Subtype: Clone + Copy + From<u8> + Into<u8>,
impl<Subtype> Clone for ProprietaryKey<Subtype>where
Subtype: Clone + Copy + From<u8> + Into<u8>,
source§fn clone(&self) -> ProprietaryKey<Subtype>
fn clone(&self) -> ProprietaryKey<Subtype>
Returns a copy 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<Subtype> Debug for ProprietaryKey<Subtype>where
Subtype: Debug + Copy + From<u8> + Into<u8>,
impl<Subtype> Debug for ProprietaryKey<Subtype>where
Subtype: Debug + Copy + From<u8> + Into<u8>,
source§impl<Subtype> Decodable for ProprietaryKey<Subtype>where
Subtype: Copy + From<u8> + Into<u8>,
impl<Subtype> Decodable for ProprietaryKey<Subtype>where
Subtype: Copy + From<u8> + Into<u8>,
source§fn consensus_decode<R>(r: &mut R) -> Result<ProprietaryKey<Subtype>, Error>where
R: Read + ?Sized,
fn consensus_decode<R>(r: &mut R) -> Result<ProprietaryKey<Subtype>, Error>where
R: Read + ?Sized,
Decode an object with a well-defined format. Read more
source§impl<Subtype> Encodable for ProprietaryKey<Subtype>where
Subtype: Copy + From<u8> + Into<u8>,
impl<Subtype> Encodable for ProprietaryKey<Subtype>where
Subtype: Copy + From<u8> + Into<u8>,
source§impl From<&ProprietaryKeyDescriptor> for ProprietaryKey
impl From<&ProprietaryKeyDescriptor> for ProprietaryKey
source§fn from(key: &ProprietaryKeyDescriptor) -> Self
fn from(key: &ProprietaryKeyDescriptor) -> Self
Converts to this type from the input type.
source§impl From<ProprietaryKeyDescriptor> for ProprietaryKey
impl From<ProprietaryKeyDescriptor> for ProprietaryKey
source§fn from(key: ProprietaryKeyDescriptor) -> Self
fn from(key: ProprietaryKeyDescriptor) -> Self
Converts to this type from the input type.
source§impl<Subtype> Hash for ProprietaryKey<Subtype>where
Subtype: Hash + Copy + From<u8> + Into<u8>,
impl<Subtype> Hash for ProprietaryKey<Subtype>where
Subtype: Hash + Copy + From<u8> + Into<u8>,
source§impl<Subtype> Ord for ProprietaryKey<Subtype>where
Subtype: Ord + Copy + From<u8> + Into<u8>,
impl<Subtype> Ord for ProprietaryKey<Subtype>where
Subtype: Ord + Copy + From<u8> + Into<u8>,
source§fn cmp(&self, other: &ProprietaryKey<Subtype>) -> Ordering
fn cmp(&self, other: &ProprietaryKey<Subtype>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<Subtype> PartialEq<ProprietaryKey<Subtype>> for ProprietaryKey<Subtype>where
Subtype: PartialEq<Subtype> + Copy + From<u8> + Into<u8>,
impl<Subtype> PartialEq<ProprietaryKey<Subtype>> for ProprietaryKey<Subtype>where
Subtype: PartialEq<Subtype> + Copy + From<u8> + Into<u8>,
source§fn eq(&self, other: &ProprietaryKey<Subtype>) -> bool
fn eq(&self, other: &ProprietaryKey<Subtype>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Subtype> PartialOrd<ProprietaryKey<Subtype>> for ProprietaryKey<Subtype>where
Subtype: PartialOrd<Subtype> + Copy + From<u8> + Into<u8>,
impl<Subtype> PartialOrd<ProprietaryKey<Subtype>> for ProprietaryKey<Subtype>where
Subtype: PartialOrd<Subtype> + Copy + From<u8> + Into<u8>,
source§fn partial_cmp(&self, other: &ProprietaryKey<Subtype>) -> Option<Ordering>
fn partial_cmp(&self, other: &ProprietaryKey<Subtype>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl ProprietaryKeyLnpbp4 for ProprietaryKey
impl ProprietaryKeyLnpbp4 for ProprietaryKey
source§fn lnpbp4_message(protocol_id: ProtocolId) -> ProprietaryKey
fn lnpbp4_message(protocol_id: ProtocolId) -> ProprietaryKey
Constructs PSBT_OUT_LNPBP4_MESSAGE
proprietary key.
source§fn lnpbp4_entropy() -> ProprietaryKey
fn lnpbp4_entropy() -> ProprietaryKey
Constructs PSBT_OUT_LNPBP4_ENTROPY
proprietary key.
source§fn lnpbp4_min_tree_depth() -> ProprietaryKey
fn lnpbp4_min_tree_depth() -> ProprietaryKey
Constructs PSBT_OUT_LNPBP4_MIN_TREE_DEPTH
proprietary key.
source§fn lnpbp4_protocol_info(protocol_id: ProtocolId) -> ProprietaryKey
fn lnpbp4_protocol_info(protocol_id: ProtocolId) -> ProprietaryKey
Constructs PSBT_GLOBAL_LNPBP4_PROTOCOL_INFO
proprietary key.
source§impl ProprietaryKeyOpret for ProprietaryKey
impl ProprietaryKeyOpret for ProprietaryKey
source§fn opret_host() -> ProprietaryKey
fn opret_host() -> ProprietaryKey
Constructs
PSBT_OUT_OPRET_HOST
proprietary key.source§fn opret_commitment() -> ProprietaryKey
fn opret_commitment() -> ProprietaryKey
Constructs
PSBT_OUT_OPRET_COMMITMENT
proprietary key.source§impl ProprietaryKeyTapret for ProprietaryKey
impl ProprietaryKeyTapret for ProprietaryKey
source§fn tapret_tweak() -> ProprietaryKey
fn tapret_tweak() -> ProprietaryKey
Constructs
PSBT_IN_TAPRET_TWEAK
proprietary key.source§fn tapret_host() -> ProprietaryKey
fn tapret_host() -> ProprietaryKey
Constructs
PSBT_OUT_TAPRET_HOST
proprietary key.source§fn tapret_commitment() -> ProprietaryKey
fn tapret_commitment() -> ProprietaryKey
Constructs
PSBT_OUT_TAPRET_COMMITMENT
proprietary key.source§fn tapret_proof() -> ProprietaryKey
fn tapret_proof() -> ProprietaryKey
Constructs
PSBT_OUT_TAPRET_PROOF
proprietary key.source§impl StrictDecode for ProprietaryKey<u8>
impl StrictDecode for ProprietaryKey<u8>
source§fn strict_decode<D>(d: D) -> Result<ProprietaryKey<u8>, Error>where
D: Read,
fn strict_decode<D>(d: D) -> Result<ProprietaryKey<u8>, Error>where
D: Read,
Decode with the given
std::io::Read
instance; must either
construct an instance or return implementation-specific error type.source§fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
Tries to deserialize byte array into the current type using
StrictDecode::strict_decode
. If there are some data remains in the
buffer once deserialization is completed, fails with
Error::DataNotEntirelyConsumed
. Use io::Cursor
over the buffer and
StrictDecode::strict_decode
to avoid such failures.source§fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
Reads data from file at
path
and reconstructs object from it. Fails
with Error::DataNotEntirelyConsumed
if file contains remaining
data after the object reconstruction.source§impl StrictEncode for ProprietaryKey<u8>
impl StrictEncode for ProprietaryKey<u8>
source§fn strict_encode<E>(&self, e: E) -> Result<usize, Error>where
E: Write,
fn strict_encode<E>(&self, e: E) -> Result<usize, Error>where
E: Write,
Encode with the given
std::io::Write
instance; must return result
with either amount of bytes encoded – or implementation-specific
error type.source§fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
Serializes data as a byte array using
StrictEncode::strict_encode
functionsource§impl<Subtype> TryFrom<Key> for ProprietaryKey<Subtype>where
Subtype: Copy + From<u8> + Into<u8>,
impl<Subtype> TryFrom<Key> for ProprietaryKey<Subtype>where
Subtype: Copy + From<u8> + Into<u8>,
source§fn try_from(
key: Key
) -> Result<ProprietaryKey<Subtype>, <ProprietaryKey<Subtype> as TryFrom<Key>>::Error>
fn try_from(
key: Key
) -> Result<ProprietaryKey<Subtype>, <ProprietaryKey<Subtype> as TryFrom<Key>>::Error>
Constructs a ProprietaryKey
from a Key
.
Errors
Returns Error::InvalidProprietaryKey
if key
does not start with 0xFC
byte.