[−][src]Struct bitcoin::blockdata::script::Builder
An object which can be used to construct a script piece by piece
Implementations
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(mut self: 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(mut self: Self, data: All) -> Builder
[src]
Adds a single opcode to the script
pub fn push_verify(mut self: 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 Clone for Builder
[src]
impl Debug for Builder
[src]
impl Default for Builder
[src]
Adds an individual opcode to the script
impl Display for Builder
[src]
impl Eq for Builder
[src]
impl From<Vec<u8, Global>> 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.
pub fn index(&self, index: Range<usize>) -> &[u8]ⓘ
[src]
impl Index<RangeFrom<usize>> for Builder
[src]
type Output = [u8]
The returned type after indexing.
pub fn index(&self, index: RangeFrom<usize>) -> &[u8]ⓘ
[src]
impl Index<RangeFull> for Builder
[src]
type Output = [u8]
The returned type after indexing.
pub fn index(&self, _: RangeFull) -> &[u8]ⓘ
[src]
impl Index<RangeTo<usize>> for Builder
[src]
type Output = [u8]
The returned type after indexing.
pub fn index(&self, index: RangeTo<usize>) -> &[u8]ⓘ
[src]
impl Index<usize> for Builder
[src]
impl PartialEq<Builder> for Builder
[src]
impl StructuralEq for Builder
[src]
impl StructuralPartialEq for Builder
[src]
Auto Trait Implementations
impl RefUnwindSafe for Builder
[src]
impl Send for Builder
[src]
impl Sync for Builder
[src]
impl Unpin for Builder
[src]
impl UnwindSafe for Builder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub 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>,