Struct dbc::tapret::TapretCommitment
source · pub struct TapretCommitment {
pub mpc: Commitment,
pub nonce: u8,
}
Expand description
Information about tapret commitment.
Fields§
§mpc: Commitment
LNPBP-4 multi-protocol commitment.
nonce: u8
Nonce is used to put the commitment into the correct side of the tree.
Implementations§
source§impl TapretCommitment
impl TapretCommitment
sourcepub fn with(mpc: Commitment, nonce: u8) -> Self
pub fn with(mpc: Commitment, nonce: u8) -> Self
Constructs information about tapret commitment.
Trait Implementations§
source§impl Clone for TapretCommitment
impl Clone for TapretCommitment
source§fn clone(&self) -> TapretCommitment
fn clone(&self) -> TapretCommitment
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 CommitEncode for TapretCommitment
impl CommitEncode for TapretCommitment
source§fn commit_encode(&self, e: &mut impl Write)
fn commit_encode(&self, e: &mut impl Write)
Encodes the data for the commitment by writing them directly into a
io::Write
writer instancesource§impl CommitVerify<TapretCommitment, Lnpbp12> for TapScript
impl CommitVerify<TapretCommitment, Lnpbp12> for TapScript
source§fn commit(commitment: &TapretCommitment) -> Self
fn commit(commitment: &TapretCommitment) -> Self
Tapret script consists of 29 OP_RESERVED
pushes, followed by
OP_RETURN
, OP_PUSHBYTES_33
and serialized commitment data (MPC
commitment + nonce as a single slice).
source§impl Debug for TapretCommitment
impl Debug for TapretCommitment
source§impl<'de> Deserialize<'de> for TapretCommitment
impl<'de> Deserialize<'de> for TapretCommitment
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
source§impl Display for TapretCommitment
impl Display for TapretCommitment
source§impl FromStr for TapretCommitment
impl FromStr for TapretCommitment
source§impl Hash for TapretCommitment
impl Hash for TapretCommitment
source§impl Ord for TapretCommitment
impl Ord for TapretCommitment
source§fn cmp(&self, other: &TapretCommitment) -> Ordering
fn cmp(&self, other: &TapretCommitment) -> 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 PartialEq for TapretCommitment
impl PartialEq for TapretCommitment
source§fn eq(&self, other: &TapretCommitment) -> bool
fn eq(&self, other: &TapretCommitment) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TapretCommitment
impl PartialOrd for TapretCommitment
source§fn partial_cmp(&self, other: &TapretCommitment) -> Option<Ordering>
fn partial_cmp(&self, other: &TapretCommitment) -> 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 Serialize for TapretCommitment
impl Serialize for TapretCommitment
source§impl StrictDecode for TapretCommitment
impl StrictDecode for TapretCommitment
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(lim: usize, reader: impl Read) -> Result<Self, DecodeError>
source§impl StrictDeserialize for TapretCommitment
impl StrictDeserialize for TapretCommitment
fn from_strict_serialized<const MAX: usize>( ast_data: Confined<Vec<u8>, 0, MAX> ) -> Result<Self, DeserializeError>
fn strict_deserialize_from_file<const MAX: usize>( path: impl AsRef<Path> ) -> Result<Self, DeserializeError>
source§impl StrictDumb for TapretCommitment
impl StrictDumb for TapretCommitment
fn strict_dumb() -> Self
source§impl StrictEncode for TapretCommitment
impl StrictEncode for TapretCommitment
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, lim: usize, writer: impl Write) -> Result<usize, Error>
source§impl StrictSerialize for TapretCommitment
impl StrictSerialize for TapretCommitment
fn strict_serialized_len(&self) -> Result<usize, Error>
fn to_strict_serialized<const MAX: usize>( &self ) -> Result<Confined<Vec<u8>, 0, MAX>, SerializeError>
fn strict_serialize_to_file<const MAX: usize>( &self, path: impl AsRef<Path> ) -> Result<(), SerializeError>
source§impl StrictStruct for TapretCommitment
impl StrictStruct for TapretCommitment
const ALL_FIELDS: &'static [&'static str] = _
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
source§impl StrictType for TapretCommitment
impl StrictType for TapretCommitment
const STRICT_LIB_NAME: &'static str = LIB_NAME_BPCORE
fn strict_name() -> Option<TypeName>
impl Eq for TapretCommitment
impl StrictProduct for TapretCommitment
impl StructuralEq for TapretCommitment
impl StructuralPartialEq for TapretCommitment
Auto Trait Implementations§
impl RefUnwindSafe for TapretCommitment
impl Send for TapretCommitment
impl Sync for TapretCommitment
impl Unpin for TapretCommitment
impl UnwindSafe for TapretCommitment
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.