pub struct Builder<T>(/* private fields */);Expand description
Script builder.
Implementations§
Source§impl<T> Builder<T>
impl<T> Builder<T>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a builder with reserved capacity.
Sourcepub fn push_int(self, n: i32) -> Result<Self, Error>
pub fn push_int(self, n: i32) -> Result<Self, Error>
Pushes an integer.
§Errors
Returns Error::NumericOverflow when n is outside the minimally encodable range.
Sourcepub fn push_int_unchecked(self, n: i64) -> Self
pub fn push_int_unchecked(self, n: i64) -> Self
Pushes an integer without range checking.
Sourcepub fn push_int_non_minimal(self, data: i64) -> Self
pub fn push_int_non_minimal(self, data: i64) -> Self
Pushes an integer without numeric-opcode optimization.
Sourcepub fn push_slice<D: AsRef<[u8]>>(self, data: D) -> Self
pub fn push_slice<D: AsRef<[u8]>>(self, data: D) -> Self
Pushes a slice.
Sourcepub fn push_slice_non_minimal<D: AsRef<[u8]>>(self, data: D) -> Self
pub fn push_slice_non_minimal<D: AsRef<[u8]>>(self, data: D) -> Self
Pushes a slice without minimal-push optimization.
Sourcepub fn push_opcode(self, opcode: Opcode) -> Self
pub fn push_opcode(self, opcode: Opcode) -> Self
Pushes an opcode.
Sourcepub fn push_verify(self) -> Self
pub fn push_verify(self) -> Self
Adds OP_VERIFY or rewrites the most recent opcode to its VERIFY form when possible.
Sourcepub fn into_script(self) -> ScriptBuf<T>
pub fn into_script(self) -> ScriptBuf<T>
Converts into a script.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Converts into raw bytes.
Trait Implementations§
impl<T: Eq> Eq for Builder<T>
impl<T: PartialEq> StructuralPartialEq for Builder<T>
Auto Trait Implementations§
impl<T> Freeze for Builder<T>
impl<T> RefUnwindSafe for Builder<T>where
T: RefUnwindSafe,
impl<T> Send for Builder<T>where
T: Send,
impl<T> Sync for Builder<T>where
T: Sync,
impl<T> Unpin for Builder<T>where
T: Unpin,
impl<T> UnsafeUnpin for Builder<T>
impl<T> UnwindSafe for Builder<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more