[−][src]Struct bitcoin::blockdata::script::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(&self) -> 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]
impl Index<Range<usize>> for Builder
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &[u8]
[src]
impl Index<RangeTo<usize>> for Builder
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, index: RangeTo<usize>) -> &[u8]
[src]
impl Index<RangeFrom<usize>> for Builder
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, index: RangeFrom<usize>) -> &[u8]
[src]
impl Index<RangeFull> for Builder
[src]
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]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,