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
sourceimpl<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>
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
sourceimpl<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>,
sourcefn clone(&self) -> ProprietaryKey<Subtype>
fn clone(&self) -> ProprietaryKey<Subtype>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<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>,
sourceimpl<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>,
sourcefn consensus_decode<D>(d: D) -> Result<ProprietaryKey<Subtype>, Error> where
D: Read,
fn consensus_decode<D>(d: D) -> Result<ProprietaryKey<Subtype>, Error> where
D: Read,
Decode an object with a well-defined format
sourceimpl<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>,
sourceimpl From<&ProprietaryKeyDescriptor> for ProprietaryKey
impl From<&ProprietaryKeyDescriptor> for ProprietaryKey
sourcefn from(key: &ProprietaryKeyDescriptor) -> Self
fn from(key: &ProprietaryKeyDescriptor) -> Self
Converts to this type from the input type.
sourceimpl From<ProprietaryKeyDescriptor> for ProprietaryKey
impl From<ProprietaryKeyDescriptor> for ProprietaryKey
sourcefn from(key: ProprietaryKeyDescriptor) -> Self
fn from(key: ProprietaryKeyDescriptor) -> Self
Converts to this type from the input type.
sourceimpl<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>,
sourceimpl<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>,
sourcefn cmp(&self, other: &ProprietaryKey<Subtype>) -> Ordering
fn cmp(&self, other: &ProprietaryKey<Subtype>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<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>,
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &ProprietaryKey<Subtype>) -> bool
fn ne(&self, other: &ProprietaryKey<Subtype>) -> bool
This method tests for !=
.
sourceimpl<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>,
sourcefn partial_cmp(&self, other: &ProprietaryKey<Subtype>) -> Option<Ordering>
fn partial_cmp(&self, other: &ProprietaryKey<Subtype>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl ProprietaryKeyLnpbp4 for ProprietaryKey
impl ProprietaryKeyLnpbp4 for ProprietaryKey
sourcefn lnpbp4_message(protocol_id: ProtocolId) -> ProprietaryKey
fn lnpbp4_message(protocol_id: ProtocolId) -> ProprietaryKey
Constructs PSBT_OUT_LNPBP4_MESSAGE
proprietary key.
sourcefn lnpbp4_entropy() -> ProprietaryKey
fn lnpbp4_entropy() -> ProprietaryKey
Constructs PSBT_OUT_LNPBP4_ENTROPY
proprietary key.
sourcefn lnpbp4_min_tree_depth() -> ProprietaryKey
fn lnpbp4_min_tree_depth() -> ProprietaryKey
Constructs PSBT_OUT_LNPBP4_MIN_TREE_DEPTH
proprietary key.
sourcefn lnpbp4_protocol_info(protocol_id: ProtocolId) -> ProprietaryKey
fn lnpbp4_protocol_info(protocol_id: ProtocolId) -> ProprietaryKey
Constructs PSBT_GLOBAL_LNPBP4_PROTOCOL_INFO
proprietary key.
sourceimpl ProprietaryKeyOpret for ProprietaryKey
impl ProprietaryKeyOpret for ProprietaryKey
sourcefn opret_host() -> ProprietaryKey
fn opret_host() -> ProprietaryKey
Constructs PSBT_OUT_OPRET_HOST
proprietary key.
sourcefn opret_commitment() -> ProprietaryKey
fn opret_commitment() -> ProprietaryKey
Constructs PSBT_OUT_OPRET_COMMITMENT
proprietary key.
sourceimpl ProprietaryKeyTapret for ProprietaryKey
impl ProprietaryKeyTapret for ProprietaryKey
sourcefn tapret_tweak() -> ProprietaryKey
fn tapret_tweak() -> ProprietaryKey
Constructs PSBT_IN_TAPRET_TWEAK
proprietary key.
sourcefn tapret_host() -> ProprietaryKey
fn tapret_host() -> ProprietaryKey
Constructs PSBT_OUT_TAPRET_HOST
proprietary key.
sourcefn tapret_commitment() -> ProprietaryKey
fn tapret_commitment() -> ProprietaryKey
Constructs PSBT_OUT_TAPRET_COMMITMENT
proprietary key.
sourcefn tapret_proof() -> ProprietaryKey
fn tapret_proof() -> ProprietaryKey
Constructs PSBT_OUT_TAPRET_PROOF
proprietary key.
sourceimpl StrictDecode for ProprietaryKey<u8>
impl StrictDecode for ProprietaryKey<u8>
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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. Read more
sourceimpl StrictEncode for ProprietaryKey<u8>
impl StrictEncode for ProprietaryKey<u8>
sourcefn 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. Read more
sourcefn 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
function Read more
impl<Subtype> Eq for ProprietaryKey<Subtype> where
Subtype: Eq + Copy + From<u8> + Into<u8>,
impl<Subtype> StructuralEq for ProprietaryKey<Subtype> where
Subtype: Copy + From<u8> + Into<u8>,
impl<Subtype> StructuralPartialEq for ProprietaryKey<Subtype> where
Subtype: Copy + From<u8> + Into<u8>,
Auto Trait Implementations
impl<Subtype> RefUnwindSafe for ProprietaryKey<Subtype> where
Subtype: RefUnwindSafe,
impl<Subtype> Send for ProprietaryKey<Subtype> where
Subtype: Send,
impl<Subtype> Sync for ProprietaryKey<Subtype> where
Subtype: Sync,
impl<Subtype> Unpin for ProprietaryKey<Subtype> where
Subtype: Unpin,
impl<Subtype> UnwindSafe for ProprietaryKey<Subtype> where
Subtype: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more