Struct bitcoin::blockdata::script::Builder [−][src]
pub struct Builder(_, _);
An object which can be used to construct a script piece by piece
Implementations
impl Builder
[src]
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