pub struct TapscriptPreimage {
pub sibling_preimage: Vec<u8>,
pub sibling_type: TapscriptPreimageType,
}Expand description
Wraps a pre-image byte slice with a type byte that self identifies what type of pre-image it is.
This corresponds to commitment.TapscriptPreimage in Go.
Fields§
§sibling_preimage: Vec<u8>The pre-image itself. This will be 64 bytes if representing a TapBranch, or any size under 4 MBytes if representing a TapLeaf.
sibling_type: TapscriptPreimageTypeThe type of the pre-image.
Implementations§
Source§impl TapscriptPreimage
impl TapscriptPreimage
Sourcepub fn decode_tlv<R: Read>(r: R) -> Result<Self, Error>
pub fn decode_tlv<R: Read>(r: R) -> Result<Self, Error>
Decodes a TapscriptPreimage directly from a reader. The format is: 1-byte type, then variable-length preimage bytes.
Trait Implementations§
Source§impl Clone for TapscriptPreimage
impl Clone for TapscriptPreimage
Source§fn clone(&self) -> TapscriptPreimage
fn clone(&self) -> TapscriptPreimage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TapscriptPreimage
impl Debug for TapscriptPreimage
Source§impl<'de> Deserialize<'de> for TapscriptPreimage
impl<'de> Deserialize<'de> for TapscriptPreimage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TapscriptPreimage
Source§impl PartialEq for TapscriptPreimage
impl PartialEq for TapscriptPreimage
Source§fn eq(&self, other: &TapscriptPreimage) -> bool
fn eq(&self, other: &TapscriptPreimage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TapscriptPreimage
impl Serialize for TapscriptPreimage
impl StructuralPartialEq for TapscriptPreimage
Auto Trait Implementations§
impl Freeze for TapscriptPreimage
impl RefUnwindSafe for TapscriptPreimage
impl Send for TapscriptPreimage
impl Sync for TapscriptPreimage
impl Unpin for TapscriptPreimage
impl UnsafeUnpin for TapscriptPreimage
impl UnwindSafe for TapscriptPreimage
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