Struct bp::ScriptPubkey
source · pub struct ScriptPubkey(_);
Implementations§
source§impl ScriptPubkey
impl ScriptPubkey
pub fn new() -> ScriptPubkey
pub fn with_capacity(capacity: usize) -> ScriptPubkey
pub fn op_return(data: &[u8]) -> ScriptPubkey
pub fn is_op_return(&self) -> bool
sourcepub fn push_opcode(&mut self, op_code: OpCode)
pub fn push_opcode(&mut self, op_code: OpCode)
Adds a single opcode to the script.
source§impl ScriptPubkey
impl ScriptPubkey
sourcepub fn from_witness_program(witness_program: &WitnessProgram) -> ScriptPubkey
pub fn from_witness_program(witness_program: &WitnessProgram) -> ScriptPubkey
Generates P2WSH-type of scriptPubkey with a given WitnessProgram
.
source§impl ScriptPubkey
impl ScriptPubkey
pub fn p2tr( internal_key: InternalPk, merkle_root: Option<impl IntoTapHash> ) -> ScriptPubkey
pub fn p2tr_tweaked(output_key: XOnlyPublicKey) -> ScriptPubkey
pub fn is_p2tr(&self) -> bool
Trait Implementations§
source§impl AsMut<<ScriptPubkey as Wrapper>::Inner> for ScriptPubkey
impl AsMut<<ScriptPubkey as Wrapper>::Inner> for ScriptPubkey
source§impl AsRef<<ScriptPubkey as Wrapper>::Inner> for ScriptPubkey
impl AsRef<<ScriptPubkey as Wrapper>::Inner> for ScriptPubkey
source§impl Borrow<<ScriptPubkey as Wrapper>::Inner> for ScriptPubkey
impl Borrow<<ScriptPubkey as Wrapper>::Inner> for ScriptPubkey
source§impl Borrow<[u8]> for ScriptPubkey
impl Borrow<[u8]> for ScriptPubkey
source§impl BorrowMut<<ScriptPubkey as Wrapper>::Inner> for ScriptPubkey
impl BorrowMut<<ScriptPubkey as Wrapper>::Inner> for ScriptPubkey
source§fn borrow_mut(&mut self) -> &mut <ScriptPubkey as Wrapper>::Inner
fn borrow_mut(&mut self) -> &mut <ScriptPubkey as Wrapper>::Inner
Mutably borrows from an owned value. Read more
source§impl BorrowMut<[u8]> for ScriptPubkey
impl BorrowMut<[u8]> for ScriptPubkey
source§impl Clone for ScriptPubkey
impl Clone for ScriptPubkey
source§fn clone(&self) -> ScriptPubkey
fn clone(&self) -> ScriptPubkey
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 ConvolveCommit<Commitment, TapretProof, Lnpbp12> for ScriptPubkey
impl ConvolveCommit<Commitment, TapretProof, Lnpbp12> for ScriptPubkey
§type Commitment = ScriptPubkey
type Commitment = ScriptPubkey
Commitment type produced as a result of
Self::convolve_commit
procedure.§type CommitError = TapretKeyError
type CommitError = TapretKeyError
Error type that may be reported during
Self::convolve_commit
procedure. It may also be returned from ConvolveCommitProof::verify
in case the proof data are invalid and the commitment can’t be
re-created.source§fn convolve_commit(
&self,
supplement: &TapretProof,
msg: &Commitment
) -> Result<(ScriptPubkey, TapretProof), <ScriptPubkey as ConvolveCommit<Commitment, TapretProof, Lnpbp12>>::CommitError>
fn convolve_commit( &self, supplement: &TapretProof, msg: &Commitment ) -> Result<(ScriptPubkey, TapretProof), <ScriptPubkey as ConvolveCommit<Commitment, TapretProof, Lnpbp12>>::CommitError>
Takes the
supplement
to unparse the content of this container (self
)
(“convolves” these two data together) and uses them to produce a final
Self::Commitment
to the message msg
. Read moresource§impl Debug for ScriptPubkey
impl Debug for ScriptPubkey
source§impl Default for ScriptPubkey
impl Default for ScriptPubkey
source§fn default() -> ScriptPubkey
fn default() -> ScriptPubkey
Returns the “default value” for a type. Read more
source§impl Deref for ScriptPubkey
impl Deref for ScriptPubkey
source§impl DerefMut for ScriptPubkey
impl DerefMut for ScriptPubkey
source§impl<'de> Deserialize<'de> for ScriptPubkey
impl<'de> Deserialize<'de> for ScriptPubkey
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ScriptPubkey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<ScriptPubkey, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<ScriptBytes> for ScriptPubkey
impl From<ScriptBytes> for ScriptPubkey
source§fn from(v: ScriptBytes) -> ScriptPubkey
fn from(v: ScriptBytes) -> ScriptPubkey
Converts to this type from the input type.
source§impl From<ScriptPubkey> for ScriptBytes
impl From<ScriptPubkey> for ScriptBytes
source§fn from(wrapped: ScriptPubkey) -> ScriptBytes
fn from(wrapped: ScriptPubkey) -> ScriptBytes
Converts to this type from the input type.
source§impl Hash for ScriptPubkey
impl Hash for ScriptPubkey
source§impl Index<RangeFull> for ScriptPubkey
impl Index<RangeFull> for ScriptPubkey
source§impl Index<RangeInclusive<usize>> for ScriptPubkey
impl Index<RangeInclusive<usize>> for ScriptPubkey
§type Output = <<ScriptPubkey as Wrapper>::Inner as Index<RangeInclusive<usize>>>::Output
type Output = <<ScriptPubkey as Wrapper>::Inner as Index<RangeInclusive<usize>>>::Output
The returned type after indexing.
source§fn index(
&self,
index: RangeInclusive<usize>
) -> &<ScriptPubkey as Index<RangeInclusive<usize>>>::Output
fn index( &self, index: RangeInclusive<usize> ) -> &<ScriptPubkey as Index<RangeInclusive<usize>>>::Output
Performs the indexing (
container[index]
) operation. Read moresource§impl Index<RangeToInclusive<usize>> for ScriptPubkey
impl Index<RangeToInclusive<usize>> for ScriptPubkey
§type Output = <<ScriptPubkey as Wrapper>::Inner as Index<RangeInclusive<usize>>>::Output
type Output = <<ScriptPubkey as Wrapper>::Inner as Index<RangeInclusive<usize>>>::Output
The returned type after indexing.
source§fn index(
&self,
index: RangeToInclusive<usize>
) -> &<ScriptPubkey as Index<RangeToInclusive<usize>>>::Output
fn index( &self, index: RangeToInclusive<usize> ) -> &<ScriptPubkey as Index<RangeToInclusive<usize>>>::Output
Performs the indexing (
container[index]
) operation. Read moresource§impl Index<usize> for ScriptPubkey
impl Index<usize> for ScriptPubkey
source§impl IndexMut<RangeFull> for ScriptPubkey
impl IndexMut<RangeFull> for ScriptPubkey
source§impl IndexMut<RangeInclusive<usize>> for ScriptPubkey
impl IndexMut<RangeInclusive<usize>> for ScriptPubkey
source§fn index_mut(
&mut self,
index: RangeInclusive<usize>
) -> &mut <ScriptPubkey as Index<RangeInclusive<usize>>>::Output
fn index_mut( &mut self, index: RangeInclusive<usize> ) -> &mut <ScriptPubkey as Index<RangeInclusive<usize>>>::Output
Performs the mutable indexing (
container[index]
) operation. Read moresource§impl IndexMut<RangeToInclusive<usize>> for ScriptPubkey
impl IndexMut<RangeToInclusive<usize>> for ScriptPubkey
source§fn index_mut(
&mut self,
index: RangeToInclusive<usize>
) -> &mut <ScriptPubkey as Index<RangeToInclusive<usize>>>::Output
fn index_mut( &mut self, index: RangeToInclusive<usize> ) -> &mut <ScriptPubkey as Index<RangeToInclusive<usize>>>::Output
Performs the mutable indexing (
container[index]
) operation. Read moresource§impl IndexMut<usize> for ScriptPubkey
impl IndexMut<usize> for ScriptPubkey
source§impl LowerHex for ScriptPubkey
impl LowerHex for ScriptPubkey
source§impl Ord for ScriptPubkey
impl Ord for ScriptPubkey
source§fn cmp(&self, other: &ScriptPubkey) -> Ordering
fn cmp(&self, other: &ScriptPubkey) -> 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<ScriptPubkey> for ScriptPubkey
impl PartialEq<ScriptPubkey> for ScriptPubkey
source§fn eq(&self, other: &ScriptPubkey) -> bool
fn eq(&self, other: &ScriptPubkey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ScriptPubkey> for ScriptPubkey
impl PartialOrd<ScriptPubkey> for ScriptPubkey
source§fn partial_cmp(&self, other: &ScriptPubkey) -> Option<Ordering>
fn partial_cmp(&self, other: &ScriptPubkey) -> 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 ScriptPubkey
impl Serialize for ScriptPubkey
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl StrictDecode for ScriptPubkey
impl StrictDecode for ScriptPubkey
fn strict_decode( reader: &mut impl TypedRead ) -> Result<ScriptPubkey, DecodeError>
source§impl StrictEncode for ScriptPubkey
impl StrictEncode for ScriptPubkey
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where W: TypedWrite,
source§impl StrictTuple for ScriptPubkey
impl StrictTuple for ScriptPubkey
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
source§impl StrictType for ScriptPubkey
impl StrictType for ScriptPubkey
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
source§impl UpperHex for ScriptPubkey
impl UpperHex for ScriptPubkey
source§impl Wrapper for ScriptPubkey
impl Wrapper for ScriptPubkey
§type Inner = ScriptBytes
type Inner = ScriptBytes
Inner type wrapped by the current newtype
source§fn from_inner(inner: <ScriptPubkey as Wrapper>::Inner) -> ScriptPubkey
fn from_inner(inner: <ScriptPubkey as Wrapper>::Inner) -> ScriptPubkey
Instantiates wrapper type with the inner data
source§fn as_inner(&self) -> &<ScriptPubkey as Wrapper>::Inner
fn as_inner(&self) -> &<ScriptPubkey as Wrapper>::Inner
Returns reference to the inner representation for the wrapper type
source§fn into_inner(self) -> <ScriptPubkey as Wrapper>::Inner
fn into_inner(self) -> <ScriptPubkey as Wrapper>::Inner
Unwraps the wrapper returning the inner type
source§impl WrapperMut for ScriptPubkey
impl WrapperMut for ScriptPubkey
source§fn as_inner_mut(&mut self) -> &mut <ScriptPubkey as Wrapper>::Inner
fn as_inner_mut(&mut self) -> &mut <ScriptPubkey as Wrapper>::Inner
Returns a mutable reference to the inner representation for the wrapper
type
impl Eq for ScriptPubkey
impl StrictProduct for ScriptPubkey
impl StructuralEq for ScriptPubkey
impl StructuralPartialEq for ScriptPubkey
Auto Trait Implementations§
impl RefUnwindSafe for ScriptPubkey
impl Send for ScriptPubkey
impl Sync for ScriptPubkey
impl Unpin for ScriptPubkey
impl UnwindSafe for ScriptPubkey
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.