pub struct Script<'a> {
pub bytes: &'a [u8],
}Expand description
A raw locking or unlocking script.
All bytes borrow from the original parse buffer.
Fields§
§bytes: &'a [u8]The raw opcodes + push-data bytes.
Implementations§
Source§impl<'a> Script<'a>
impl<'a> Script<'a>
Sourcepub fn parse(cursor: &mut Cursor<'a>) -> ParseResult<Self>
pub fn parse(cursor: &mut Cursor<'a>) -> ParseResult<Self>
Parse a length-prefixed script from cursor.
Sourcepub fn script_type(&self) -> ScriptType<'a>
pub fn script_type(&self) -> ScriptType<'a>
Classify the script into a well-known output type.
Sourcepub fn instructions(&self) -> Instructions<'a> ⓘ
pub fn instructions(&self) -> Instructions<'a> ⓘ
Iterate over parsed opcodes / push-data in this script.
Trait Implementations§
impl<'a> Copy for Script<'a>
impl<'a> Eq for Script<'a>
impl<'a> StructuralPartialEq for Script<'a>
Auto Trait Implementations§
impl<'a> Freeze for Script<'a>
impl<'a> RefUnwindSafe for Script<'a>
impl<'a> Send for Script<'a>
impl<'a> Sync for Script<'a>
impl<'a> Unpin for Script<'a>
impl<'a> UnsafeUnpin for Script<'a>
impl<'a> UnwindSafe for Script<'a>
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