pub struct Opcode { /* private fields */ }
Expand description
A script Opcode.
We do not implement Ord on this type because there is no natural ordering on opcodes, but there
may appear to be one (e.g. because all the push opcodes appear in a consecutive block) and we
don’t want to encourage subtly buggy code. Please use Opcode::classify
to distinguish different
types of opcodes.
Example of Core bug caused by assuming ordering
Bitcoin Core’s IsPushOnly
considers OP_RESERVED
to be a “push code”, allowing this opcode
in contexts where only pushes are supposed to be allowed.
Implementations§
Trait Implementations§
Source§impl From<WitnessVersion> for Opcode
impl From<WitnessVersion> for Opcode
Source§fn from(version: WitnessVersion) -> Opcode
fn from(version: WitnessVersion) -> Opcode
Converts to this type from the input type.
Source§impl TryFrom<Opcode> for WitnessVersion
impl TryFrom<Opcode> for WitnessVersion
impl Copy for Opcode
impl Eq for Opcode
impl StructuralPartialEq for Opcode
Auto Trait Implementations§
impl Freeze for Opcode
impl RefUnwindSafe for Opcode
impl Send for Opcode
impl Sync for Opcode
impl Unpin for Opcode
impl UnwindSafe for Opcode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)