[][src]Struct bitcoin::blockdata::script::Builder

pub struct Builder(_, _);

An object which can be used to construct a script piece by piece

Methods

impl Builder[src]

pub fn new() -> Self[src]

Creates a new empty script

pub fn len(&self) -> usize[src]

The length in bytes of the script

pub fn is_empty(&self) -> bool[src]

Whether the script is the empty script

pub fn push_int(self, data: i64) -> Builder[src]

Adds instructions to push an integer onto the stack. Integers are encoded as little-endian signed-magnitude numbers, but there are dedicated opcodes to push some small integers.

pub fn push_scriptint(self, data: i64) -> Builder[src]

Adds instructions to push an integer onto the stack, using the explicit encoding regardless of the availability of dedicated opcodes.

pub fn push_slice(self, data: &[u8]) -> Builder[src]

Adds instructions to push some arbitrary data onto the stack

pub fn push_key(self, key: &PublicKey) -> Builder[src]

Pushes a public key

pub fn push_opcode(self, data: All) -> Builder[src]

Adds a single opcode to the script

pub fn push_verify(self) -> Builder[src]

Adds an OP_VERIFY to the script, unless the most-recently-added opcode has an alternate VERIFY form, in which case that opcode is replaced. e.g. OP_CHECKSIG will become OP_CHECKSIGVERIFY.

pub fn into_script(self) -> Script[src]

Converts the Builder into an unmodifiable Script

Trait Implementations

impl From<Vec<u8>> for Builder[src]

Creates a new script from an existing vector

impl Default for Builder[src]

Adds an individual opcode to the script

impl Clone for Builder[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Builder> for Builder[src]

impl Eq for Builder[src]

impl Display for Builder[src]

impl Debug for Builder[src]

impl Index<usize> for Builder[src]

type Output = u8

The returned type after indexing.

impl Index<Range<usize>> for Builder[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeTo<usize>> for Builder[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeFrom<usize>> for Builder[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeFull> for Builder[src]

type Output = [u8]

The returned type after indexing.

Auto Trait Implementations

impl Unpin for Builder

impl Sync for Builder

impl Send for Builder

impl UnwindSafe for Builder

impl RefUnwindSafe for Builder

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]