pub struct PushBytes(/* private fields */);Expand description
Byte slices that can be pushed into script.
Implementations§
Source§impl PushBytes
impl PushBytes
Sourcepub fn as_mut_bytes(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_bytes(&mut self) -> &mut [u8] ⓘ
Returns the underlying mutable bytes.
Sourcepub fn read_scriptint(&self) -> Result<i32, ScriptIntError>
pub fn read_scriptint(&self) -> Result<i32, ScriptIntError>
Decodes a minimal script integer with the standard 4-byte bound.
§Errors
Returns ScriptIntError when the encoding is non-minimal or overflows the 4-byte bound.
§Panics
Panics only if the internal 4-byte bound invariant is violated.
Sourcepub fn read_cltv_scriptint(&self) -> Result<i64, ScriptIntError>
pub fn read_cltv_scriptint(&self) -> Result<i64, ScriptIntError>
Decodes a minimal script integer with the CHECKLOCKTIMEVERIFY 5-byte bound.
§Errors
Returns ScriptIntError when the encoding is non-minimal or overflows the 5-byte bound.
Trait Implementations§
Source§impl AsMut<PushBytes> for PushBytesBuf
impl AsMut<PushBytes> for PushBytesBuf
Source§impl AsRef<PushBytes> for PushBytesBuf
impl AsRef<PushBytes> for PushBytesBuf
Source§impl Borrow<PushBytes> for PushBytesBuf
impl Borrow<PushBytes> for PushBytesBuf
Source§impl BorrowMut<PushBytes> for PushBytesBuf
impl BorrowMut<PushBytes> for PushBytesBuf
Source§fn borrow_mut(&mut self) -> &mut PushBytes
fn borrow_mut(&mut self) -> &mut PushBytes
Mutably borrows from an owned value. Read more
impl Eq for PushBytes
Source§impl PartialOrd for PushBytes
impl PartialOrd for PushBytes
impl StructuralPartialEq for PushBytes
Source§impl ToOwned for PushBytes
impl ToOwned for PushBytes
Source§type Owned = PushBytesBuf
type Owned = PushBytesBuf
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more