Struct bp::ScriptBytes
source · pub struct ScriptBytes(_);
Implementations§
source§impl ScriptBytes
impl ScriptBytes
sourcepub fn push_slice(&mut self, data: &[u8])
pub fn push_slice(&mut self, data: &[u8])
Adds instructions to push some arbitrary data onto the stack.
Panics
The method panics if data
length is greater or equal to
0x100000000.
sourcepub fn len_for_slice(len: usize) -> usize
pub fn len_for_slice(len: usize) -> usize
Computes the sum of len
and the lenght of an appropriate push
opcode.
Trait Implementations§
source§impl AsMut<<ScriptBytes as Wrapper>::Inner> for ScriptBytes
impl AsMut<<ScriptBytes as Wrapper>::Inner> for ScriptBytes
source§impl AsRef<<ScriptBytes as Wrapper>::Inner> for ScriptBytes
impl AsRef<<ScriptBytes as Wrapper>::Inner> for ScriptBytes
source§impl Borrow<<ScriptBytes as Wrapper>::Inner> for ScriptBytes
impl Borrow<<ScriptBytes as Wrapper>::Inner> for ScriptBytes
source§impl Borrow<[u8]> for ScriptBytes
impl Borrow<[u8]> for ScriptBytes
source§impl BorrowMut<<ScriptBytes as Wrapper>::Inner> for ScriptBytes
impl BorrowMut<<ScriptBytes as Wrapper>::Inner> for ScriptBytes
source§fn borrow_mut(&mut self) -> &mut <ScriptBytes as Wrapper>::Inner
fn borrow_mut(&mut self) -> &mut <ScriptBytes as Wrapper>::Inner
Mutably borrows from an owned value. Read more
source§impl BorrowMut<[u8]> for ScriptBytes
impl BorrowMut<[u8]> for ScriptBytes
source§impl Clone for ScriptBytes
impl Clone for ScriptBytes
source§fn clone(&self) -> ScriptBytes
fn clone(&self) -> ScriptBytes
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 Debug for ScriptBytes
impl Debug for ScriptBytes
source§impl Default for ScriptBytes
impl Default for ScriptBytes
source§fn default() -> ScriptBytes
fn default() -> ScriptBytes
Returns the “default value” for a type. Read more
source§impl Deref for ScriptBytes
impl Deref for ScriptBytes
source§impl DerefMut for ScriptBytes
impl DerefMut for ScriptBytes
source§impl<'de> Deserialize<'de> for ScriptBytes
impl<'de> Deserialize<'de> for ScriptBytes
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ScriptBytes, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<ScriptBytes, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Confined<Vec<u8, Global>, 0, bc::::types::VarIntArray::{constant#1}>> for ScriptBytes
impl From<Confined<Vec<u8, Global>, 0, bc::::types::VarIntArray::{constant#1}>> for ScriptBytes
source§impl From<ScriptBytes> for Confined<Vec<u8, Global>, 0, bc::::types::VarIntArray::{constant#1}>
impl From<ScriptBytes> for Confined<Vec<u8, Global>, 0, bc::::types::VarIntArray::{constant#1}>
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<ScriptBytes> for SigScript
impl From<ScriptBytes> for SigScript
source§fn from(v: ScriptBytes) -> SigScript
fn from(v: ScriptBytes) -> SigScript
Converts to this type from the input type.
source§impl From<ScriptBytes> for TapScript
impl From<ScriptBytes> for TapScript
source§fn from(v: ScriptBytes) -> TapScript
fn from(v: ScriptBytes) -> TapScript
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 From<SigScript> for ScriptBytes
impl From<SigScript> for ScriptBytes
source§fn from(wrapped: SigScript) -> ScriptBytes
fn from(wrapped: SigScript) -> ScriptBytes
Converts to this type from the input type.
source§impl From<TapScript> for ScriptBytes
impl From<TapScript> for ScriptBytes
source§fn from(wrapped: TapScript) -> ScriptBytes
fn from(wrapped: TapScript) -> ScriptBytes
Converts to this type from the input type.
source§impl Hash for ScriptBytes
impl Hash for ScriptBytes
source§impl Index<RangeFull> for ScriptBytes
impl Index<RangeFull> for ScriptBytes
source§impl Index<RangeInclusive<usize>> for ScriptBytes
impl Index<RangeInclusive<usize>> for ScriptBytes
§type Output = <<ScriptBytes as Wrapper>::Inner as Index<RangeInclusive<usize>>>::Output
type Output = <<ScriptBytes as Wrapper>::Inner as Index<RangeInclusive<usize>>>::Output
The returned type after indexing.
source§fn index(
&self,
index: RangeInclusive<usize>
) -> &<ScriptBytes as Index<RangeInclusive<usize>>>::Output
fn index( &self, index: RangeInclusive<usize> ) -> &<ScriptBytes as Index<RangeInclusive<usize>>>::Output
Performs the indexing (
container[index]
) operation. Read moresource§impl Index<RangeToInclusive<usize>> for ScriptBytes
impl Index<RangeToInclusive<usize>> for ScriptBytes
§type Output = <<ScriptBytes as Wrapper>::Inner as Index<RangeInclusive<usize>>>::Output
type Output = <<ScriptBytes as Wrapper>::Inner as Index<RangeInclusive<usize>>>::Output
The returned type after indexing.
source§fn index(
&self,
index: RangeToInclusive<usize>
) -> &<ScriptBytes as Index<RangeToInclusive<usize>>>::Output
fn index( &self, index: RangeToInclusive<usize> ) -> &<ScriptBytes as Index<RangeToInclusive<usize>>>::Output
Performs the indexing (
container[index]
) operation. Read moresource§impl Index<usize> for ScriptBytes
impl Index<usize> for ScriptBytes
source§impl IndexMut<RangeFull> for ScriptBytes
impl IndexMut<RangeFull> for ScriptBytes
source§impl IndexMut<RangeInclusive<usize>> for ScriptBytes
impl IndexMut<RangeInclusive<usize>> for ScriptBytes
source§fn index_mut(
&mut self,
index: RangeInclusive<usize>
) -> &mut <ScriptBytes as Index<RangeInclusive<usize>>>::Output
fn index_mut( &mut self, index: RangeInclusive<usize> ) -> &mut <ScriptBytes as Index<RangeInclusive<usize>>>::Output
Performs the mutable indexing (
container[index]
) operation. Read moresource§impl IndexMut<RangeToInclusive<usize>> for ScriptBytes
impl IndexMut<RangeToInclusive<usize>> for ScriptBytes
source§fn index_mut(
&mut self,
index: RangeToInclusive<usize>
) -> &mut <ScriptBytes as Index<RangeToInclusive<usize>>>::Output
fn index_mut( &mut self, index: RangeToInclusive<usize> ) -> &mut <ScriptBytes as Index<RangeToInclusive<usize>>>::Output
Performs the mutable indexing (
container[index]
) operation. Read moresource§impl IndexMut<usize> for ScriptBytes
impl IndexMut<usize> for ScriptBytes
source§impl LowerHex for ScriptBytes
impl LowerHex for ScriptBytes
source§impl Ord for ScriptBytes
impl Ord for ScriptBytes
source§fn cmp(&self, other: &ScriptBytes) -> Ordering
fn cmp(&self, other: &ScriptBytes) -> 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<ScriptBytes> for ScriptBytes
impl PartialEq<ScriptBytes> for ScriptBytes
source§fn eq(&self, other: &ScriptBytes) -> bool
fn eq(&self, other: &ScriptBytes) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ScriptBytes> for ScriptBytes
impl PartialOrd<ScriptBytes> for ScriptBytes
source§fn partial_cmp(&self, other: &ScriptBytes) -> Option<Ordering>
fn partial_cmp(&self, other: &ScriptBytes) -> 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 ScriptBytes
impl Serialize for ScriptBytes
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 ScriptBytes
impl StrictDecode for ScriptBytes
fn strict_decode( reader: &mut impl TypedRead ) -> Result<ScriptBytes, DecodeError>
source§impl StrictEncode for ScriptBytes
impl StrictEncode for ScriptBytes
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where W: TypedWrite,
source§impl StrictTuple for ScriptBytes
impl StrictTuple for ScriptBytes
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
source§impl StrictType for ScriptBytes
impl StrictType for ScriptBytes
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
source§impl UpperHex for ScriptBytes
impl UpperHex for ScriptBytes
source§impl Wrapper for ScriptBytes
impl Wrapper for ScriptBytes
§type Inner = Confined<Vec<u8, Global>, 0, bc::::types::VarIntArray::{constant#1}>
type Inner = Confined<Vec<u8, Global>, 0, bc::::types::VarIntArray::{constant#1}>
Inner type wrapped by the current newtype
source§fn from_inner(inner: <ScriptBytes as Wrapper>::Inner) -> ScriptBytes
fn from_inner(inner: <ScriptBytes as Wrapper>::Inner) -> ScriptBytes
Instantiates wrapper type with the inner data
source§fn as_inner(&self) -> &<ScriptBytes as Wrapper>::Inner
fn as_inner(&self) -> &<ScriptBytes as Wrapper>::Inner
Returns reference to the inner representation for the wrapper type
source§fn into_inner(self) -> <ScriptBytes as Wrapper>::Inner
fn into_inner(self) -> <ScriptBytes as Wrapper>::Inner
Unwraps the wrapper returning the inner type
source§impl WrapperMut for ScriptBytes
impl WrapperMut for ScriptBytes
source§fn as_inner_mut(&mut self) -> &mut <ScriptBytes as Wrapper>::Inner
fn as_inner_mut(&mut self) -> &mut <ScriptBytes as Wrapper>::Inner
Returns a mutable reference to the inner representation for the wrapper
type
impl Eq for ScriptBytes
impl StrictProduct for ScriptBytes
impl StructuralEq for ScriptBytes
impl StructuralPartialEq for ScriptBytes
Auto Trait Implementations§
impl RefUnwindSafe for ScriptBytes
impl Send for ScriptBytes
impl Sync for ScriptBytes
impl Unpin for ScriptBytes
impl UnwindSafe for ScriptBytes
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.