Struct bitcoin::blockdata::script::Builder
[−]
[src]
pub struct Builder(_);
An object which can be used to construct a script piece by piece
Methods
impl Builder
[src]
fn new() -> Builder
Creates a new empty script
fn len(&self) -> usize
The length in bytes of the script
fn is_empty(&self) -> bool
Whether the script is the empty script
fn push_int(self, data: i64) -> Builder
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.
fn push_scriptint(self, data: i64) -> Builder
Adds instructions to push an integer onto the stack, using the explicit encoding regardless of the availability of dedicated opcodes.
fn push_slice(self, data: &[u8]) -> Builder
Adds instructions to push some arbitrary data onto the stack
fn push_opcode(self, data: All) -> Builder
Adds a single opcode to the script
fn into_script(self) -> Script
Converts the Builder
into an unmodifiable Script
Trait Implementations
impl PartialEq for Builder
[src]
fn eq(&self, __arg_0: &Builder) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Builder) -> bool
This method tests for !=
.
impl Eq for Builder
[src]
impl Debug for Builder
[src]
impl Clone for Builder
[src]
fn clone(&self) -> Builder
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Display for Builder
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
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 Index<Range<usize>> for Builder
[src]
type Output = [u8]
The returned type after indexing
fn index(&self, index: Range<usize>) -> &[u8]
The method for the indexing (container[index]
) operation
impl Index<RangeTo<usize>> for Builder
[src]
type Output = [u8]
The returned type after indexing
fn index(&self, index: RangeTo<usize>) -> &[u8]
The method for the indexing (container[index]
) operation
impl Index<RangeFrom<usize>> for Builder
[src]
type Output = [u8]
The returned type after indexing
fn index(&self, index: RangeFrom<usize>) -> &[u8]
The method for the indexing (container[index]
) operation