pub struct Key {
pub type_value: u8,
pub key: Vec<u8>,
}
Expand description
A PSBT key in its raw byte form.
Fields§
§type_value: u8
The type of this PSBT key.
key: Vec<u8>
The key itself in raw byte form.
Trait Implementations§
source§impl Ord for Key
impl Ord for Key
source§impl PartialOrd for Key
impl PartialOrd for Key
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 StrictDecode for Key
impl StrictDecode for Key
source§fn strict_decode<D>(d: D) -> Result<Key, Error>where
D: Read,
fn strict_decode<D>(d: D) -> Result<Key, 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 Key
impl StrictEncode for Key
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>, Error>
fn strict_serialize(&self) -> Result<Vec<u8>, Error>
Serializes data as a byte array using
StrictEncode::strict_encode
functionsource§impl<Subtype> TryFrom<Key> for ProprietaryKey<Subtype>
impl<Subtype> TryFrom<Key> for ProprietaryKey<Subtype>
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.
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
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