[][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() -> Builder[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_opcode(self, data: All) -> Builder[src]

Adds a single opcode to the script

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

Converts the Builder into an unmodifiable Script

Trait Implementations

impl PartialEq<Builder> for Builder[src]

impl Default for Builder[src]

Adds an individual opcode to the script

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

Creates a new script from an existing vector

impl Clone for Builder[src]

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

Performs copy-assignment from source. Read more

impl Eq for Builder[src]

impl Display for Builder[src]

impl Debug for Builder[src]

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 Send for Builder

impl Sync for Builder

Blanket Implementations

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

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

type Owned = T

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]