# [−] [src] Enum script::Opcode

    #[repr(u8)]
    pub enum Opcode {
        OP_0,
        OP_PUSHBYTES_1,
        OP_PUSHBYTES_2,
        OP_PUSHBYTES_3,
        OP_PUSHBYTES_4,
        OP_PUSHBYTES_5,
        OP_PUSHBYTES_6,
        OP_PUSHBYTES_7,
        OP_PUSHBYTES_8,
        OP_PUSHBYTES_9,
        OP_PUSHBYTES_10,
        OP_PUSHBYTES_11,
        OP_PUSHBYTES_12,
        OP_PUSHBYTES_13,
        OP_PUSHBYTES_14,
        OP_PUSHBYTES_15,
        OP_PUSHBYTES_16,
        OP_PUSHBYTES_17,
        OP_PUSHBYTES_18,
        OP_PUSHBYTES_19,
        OP_PUSHBYTES_20,
        OP_PUSHBYTES_21,
        OP_PUSHBYTES_22,
        OP_PUSHBYTES_23,
        OP_PUSHBYTES_24,
        OP_PUSHBYTES_25,
        OP_PUSHBYTES_26,
        OP_PUSHBYTES_27,
        OP_PUSHBYTES_28,
        OP_PUSHBYTES_29,
        OP_PUSHBYTES_30,
        OP_PUSHBYTES_31,
        OP_PUSHBYTES_32,
        OP_PUSHBYTES_33,
        OP_PUSHBYTES_34,
        OP_PUSHBYTES_35,
        OP_PUSHBYTES_36,
        OP_PUSHBYTES_37,
        OP_PUSHBYTES_38,
        OP_PUSHBYTES_39,
        OP_PUSHBYTES_40,
        OP_PUSHBYTES_41,
        OP_PUSHBYTES_42,
        OP_PUSHBYTES_43,
        OP_PUSHBYTES_44,
        OP_PUSHBYTES_45,
        OP_PUSHBYTES_46,
        OP_PUSHBYTES_47,
        OP_PUSHBYTES_48,
        OP_PUSHBYTES_49,
        OP_PUSHBYTES_50,
        OP_PUSHBYTES_51,
        OP_PUSHBYTES_52,
        OP_PUSHBYTES_53,
        OP_PUSHBYTES_54,
        OP_PUSHBYTES_55,
        OP_PUSHBYTES_56,
        OP_PUSHBYTES_57,
        OP_PUSHBYTES_58,
        OP_PUSHBYTES_59,
        OP_PUSHBYTES_60,
        OP_PUSHBYTES_61,
        OP_PUSHBYTES_62,
        OP_PUSHBYTES_63,
        OP_PUSHBYTES_64,
        OP_PUSHBYTES_65,
        OP_PUSHBYTES_66,
        OP_PUSHBYTES_67,
        OP_PUSHBYTES_68,
        OP_PUSHBYTES_69,
        OP_PUSHBYTES_70,
        OP_PUSHBYTES_71,
        OP_PUSHBYTES_72,
        OP_PUSHBYTES_73,
        OP_PUSHBYTES_74,
        OP_PUSHBYTES_75,
        OP_PUSHDATA1,
        OP_PUSHDATA2,
        OP_PUSHDATA4,
        OP_1NEGATE,
        OP_RESERVED,
        OP_1,
        OP_2,
        OP_3,
        OP_4,
        OP_5,
        OP_6,
        OP_7,
        OP_8,
        OP_9,
        OP_10,
        OP_11,
        OP_12,
        OP_13,
        OP_14,
        OP_15,
        OP_16,
        OP_NOP,
        OP_VER,
        OP_IF,
        OP_NOTIF,
        OP_VERIF,
        OP_VERNOTIF,
        OP_ELSE,
        OP_ENDIF,
        OP_VERIFY,
        OP_RETURN,
        OP_TOALTSTACK,
        OP_FROMALTSTACK,
        OP_2DROP,
        OP_2DUP,
        OP_3DUP,
        OP_2OVER,
        OP_2ROT,
        OP_2SWAP,
        OP_IFDUP,
        OP_DEPTH,
        OP_DROP,
        OP_DUP,
        OP_NIP,
        OP_OVER,
        OP_PICK,
        OP_ROLL,
        OP_ROT,
        OP_SWAP,
        OP_TUCK,
        OP_CAT,
        OP_SUBSTR,
        OP_LEFT,
        OP_RIGHT,
        OP_SIZE,
        OP_INVERT,
        OP_AND,
        OP_OR,
        OP_XOR,
        OP_EQUAL,
        OP_EQUALVERIFY,
        OP_RESERVED1,
        OP_RESERVED2,
        OP_1ADD,
        OP_1SUB,
        OP_2MUL,
        OP_2DIV,
        OP_NEGATE,
        OP_ABS,
        OP_NOT,
        OP_0NOTEQUAL,
        OP_ADD,
        OP_SUB,
        OP_MUL,
        OP_DIV,
        OP_MOD,
        OP_LSHIFT,
        OP_RSHIFT,
        OP_BOOLAND,
        OP_BOOLOR,
        OP_NUMEQUAL,
        OP_NUMEQUALVERIFY,
        OP_NUMNOTEQUAL,
        OP_LESSTHAN,
        OP_GREATERTHAN,
        OP_LESSTHANOREQUAL,
        OP_GREATERTHANOREQUAL,
        OP_MIN,
        OP_MAX,
        OP_WITHIN,
        OP_RIPEMD160,
        OP_SHA1,
        OP_SHA256,
        OP_HASH160,
        OP_HASH256,
        OP_CODESEPARATOR,
        OP_CHECKSIG,
        OP_CHECKSIGVERIFY,
        OP_CHECKMULTISIG,
        OP_CHECKMULTISIGVERIFY,
        OP_NOP1,
        OP_CHECKLOCKTIMEVERIFY,
        OP_CHECKSEQUENCEVERIFY,
        OP_NOP4,
        OP_NOP5,
        OP_NOP6,
        OP_NOP7,
        OP_NOP8,
        OP_NOP9,
        OP_NOP10,
        OP_CHECKDATASIG,
        OP_CHECKDATASIGVERIFY,
    }

Script opcodes.

## Variants

`OP_0` `OP_PUSHBYTES_1` `OP_PUSHBYTES_2` `OP_PUSHBYTES_3` `OP_PUSHBYTES_4` `OP_PUSHBYTES_5` `OP_PUSHBYTES_6` `OP_PUSHBYTES_7` `OP_PUSHBYTES_8` `OP_PUSHBYTES_9` `OP_PUSHBYTES_10` `OP_PUSHBYTES_11` `OP_PUSHBYTES_12` `OP_PUSHBYTES_13` `OP_PUSHBYTES_14` `OP_PUSHBYTES_15` `OP_PUSHBYTES_16` `OP_PUSHBYTES_17` `OP_PUSHBYTES_18` `OP_PUSHBYTES_19` `OP_PUSHBYTES_20` `OP_PUSHBYTES_21` `OP_PUSHBYTES_22` `OP_PUSHBYTES_23` `OP_PUSHBYTES_24` `OP_PUSHBYTES_25` `OP_PUSHBYTES_26` `OP_PUSHBYTES_27` `OP_PUSHBYTES_28` `OP_PUSHBYTES_29` `OP_PUSHBYTES_30` `OP_PUSHBYTES_31` `OP_PUSHBYTES_32` `OP_PUSHBYTES_33` `OP_PUSHBYTES_34` `OP_PUSHBYTES_35` `OP_PUSHBYTES_36` `OP_PUSHBYTES_37` `OP_PUSHBYTES_38` `OP_PUSHBYTES_39` `OP_PUSHBYTES_40` `OP_PUSHBYTES_41` `OP_PUSHBYTES_42` `OP_PUSHBYTES_43` `OP_PUSHBYTES_44` `OP_PUSHBYTES_45` `OP_PUSHBYTES_46` `OP_PUSHBYTES_47` `OP_PUSHBYTES_48` `OP_PUSHBYTES_49` `OP_PUSHBYTES_50` `OP_PUSHBYTES_51` `OP_PUSHBYTES_52` `OP_PUSHBYTES_53` `OP_PUSHBYTES_54` `OP_PUSHBYTES_55` `OP_PUSHBYTES_56` `OP_PUSHBYTES_57` `OP_PUSHBYTES_58` `OP_PUSHBYTES_59` `OP_PUSHBYTES_60` `OP_PUSHBYTES_61` `OP_PUSHBYTES_62` `OP_PUSHBYTES_63` `OP_PUSHBYTES_64` `OP_PUSHBYTES_65` `OP_PUSHBYTES_66` `OP_PUSHBYTES_67` `OP_PUSHBYTES_68` `OP_PUSHBYTES_69` `OP_PUSHBYTES_70` `OP_PUSHBYTES_71` `OP_PUSHBYTES_72` `OP_PUSHBYTES_73` `OP_PUSHBYTES_74` `OP_PUSHBYTES_75` `OP_PUSHDATA1` `OP_PUSHDATA2` `OP_PUSHDATA4` `OP_1NEGATE` `OP_RESERVED` `OP_1` `OP_2` `OP_3` `OP_4` `OP_5` `OP_6` `OP_7` `OP_8` `OP_9` `OP_10` `OP_11` `OP_12` `OP_13` `OP_14` `OP_15` `OP_16` `OP_NOP` `OP_VER` `OP_IF` `OP_NOTIF` `OP_VERIF` `OP_VERNOTIF` `OP_ELSE` `OP_ENDIF` `OP_VERIFY` `OP_RETURN` `OP_TOALTSTACK` `OP_FROMALTSTACK` `OP_2DROP` `OP_2DUP` `OP_3DUP` `OP_2OVER` `OP_2ROT` `OP_2SWAP` `OP_IFDUP` `OP_DEPTH` `OP_DROP` `OP_DUP` `OP_NIP` `OP_OVER` `OP_PICK` `OP_ROLL` `OP_ROT` `OP_SWAP` `OP_TUCK` `OP_CAT` `OP_SUBSTR` `OP_LEFT` `OP_RIGHT` `OP_SIZE` `OP_INVERT` `OP_AND` `OP_OR` `OP_XOR` `OP_EQUAL` `OP_EQUALVERIFY` `OP_RESERVED1` `OP_RESERVED2` `OP_1ADD` `OP_1SUB` `OP_2MUL` `OP_2DIV` `OP_NEGATE` `OP_ABS` `OP_NOT` `OP_0NOTEQUAL` `OP_ADD` `OP_SUB` `OP_MUL` `OP_DIV` `OP_MOD` `OP_LSHIFT` `OP_RSHIFT` `OP_BOOLAND` `OP_BOOLOR` `OP_NUMEQUAL` `OP_NUMEQUALVERIFY` `OP_NUMNOTEQUAL` `OP_LESSTHAN` `OP_GREATERTHAN` `OP_LESSTHANOREQUAL` `OP_GREATERTHANOREQUAL` `OP_MIN` `OP_MAX` `OP_WITHIN` `OP_RIPEMD160` `OP_SHA1` `OP_SHA256` `OP_HASH160` `OP_HASH256` `OP_CODESEPARATOR` `OP_CHECKSIG` `OP_CHECKSIGVERIFY` `OP_CHECKMULTISIG` `OP_CHECKMULTISIGVERIFY` `OP_NOP1` `OP_CHECKLOCKTIMEVERIFY` `OP_CHECKSEQUENCEVERIFY` `OP_NOP4` `OP_NOP5` `OP_NOP6` `OP_NOP7` `OP_NOP8` `OP_NOP9` `OP_NOP10` `OP_CHECKDATASIG` `OP_CHECKDATASIGVERIFY`

## Methods

###

`impl Opcode`

[src]

####

`pub fn from_u8(u: u8) -> Option<Self>`

[src]

####

`pub fn is_disabled(&self, flags: &VerificationFlags) -> bool`

[src]

####

`pub fn is_countable(&self) -> bool`

[src]

Returns true if opcode is countable

####

`pub fn is_simple_push(&self) -> bool`

[src]

####

`pub fn is_push_value(&self) -> bool`

[src]

####

`pub fn is_within_op_n(&self) -> bool`

[src]

####

`pub fn decode_op_n(&self) -> u8`

[src]

## Trait Implementations

###

`impl Debug for Opcode`

[src]

####

`fn fmt(&self, f: &mut Formatter) -> Result`

[src]

Formats the value using the given formatter. Read more

###

`impl PartialEq for Opcode`

[src]

####

`fn eq(&self, other: &Opcode) -> bool`

[src]

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

####

`#[must_use] fn ne(&self, other: &Rhs) -> bool`

1.0.0
[src]

This method tests for `!=`.

###

`impl Eq for Opcode`

[src]

###

`impl Clone for Opcode`

[src]

####

`fn clone(&self) -> Opcode`

[src]

Returns a copy of the value. Read more

####

`fn clone_from(&mut self, source: &Self)`

1.0.0
[src]

Performs copy-assignment from `source`. Read more

###

`impl Copy for Opcode`

[src]

###

`impl PartialOrd for Opcode`

[src]

####

`fn partial_cmp(&self, other: &Opcode) -> Option<Ordering>`

[src]

This method returns an ordering between `self` and `other` values if one exists. Read more

####

`#[must_use] fn lt(&self, other: &Rhs) -> bool`

1.0.0
[src]

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

####

`#[must_use] fn le(&self, other: &Rhs) -> bool`

1.0.0
[src]

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

####

`#[must_use] fn gt(&self, other: &Rhs) -> bool`

1.0.0
[src]

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

####

`#[must_use] fn ge(&self, other: &Rhs) -> bool`

1.0.0
[src]

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

###

`impl Ord for Opcode`

[src]

####

`fn cmp(&self, other: &Opcode) -> Ordering`

[src]

This method returns an `Ordering` between `self` and `other`. Read more

####

`fn max(self, other: Self) -> Self`

1.21.0
[src]

Compares and returns the maximum of two values. Read more

####

`fn min(self, other: Self) -> Self`

1.21.0
[src]

Compares and returns the minimum of two values. Read more

###

`impl Display for Opcode`

[src]

####

`fn fmt(&self, f: &mut Formatter) -> Result`

[src]

Formats the value using the given formatter. Read more

## Auto Trait Implementations

###

`impl Send for Opcode`

###

`impl Sync for Opcode`

## Blanket Implementations

###

`impl<T> ToOwned for T where T: Clone,`

[src]

#### `type Owned = T`

####

`fn to_owned(&self) -> T`

[src]

Creates owned data from borrowed data, usually by cloning. Read more

####

`fn clone_into(&self, target: &mut T)`

[src]

🔬 This is a nightly-only experimental API. (`toowned_clone_into`)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

###

`impl<T> From for T`

[src]

####

`fn from(t: T) -> T`

[src]

Performs the conversion.

###

`impl<T> ToString for T where T: Display + ?Sized,`

[src]

####

`fn to_string(&self) -> String`

[src]

Converts the given value to a `String`. Read more

###

`impl<T, U> Into for T where U: From<T>,`

[src]

####

`fn into(self) -> U`

[src]

Performs the conversion.

###

`impl<T, U> TryFrom for T where T: From<U>,`

[src]

#### `type Error = !`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

####

`fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`

[src]

🔬 This is a nightly-only experimental API. (`try_from`)

Performs the conversion.

###

`impl<T> Borrow for T where T: ?Sized,`

[src]

####
ⓘImportant traits for &'a mut R

### Important traits for &'a mut R

`impl<'a, R> Read for &'a mut R where
R: Read + ?Sized, impl<'a, W> Write for &'a mut W where
W: Write + ?Sized, impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;`

`fn borrow(&self) -> &T`

[src]

Immutably borrows from an owned value. Read more

###

`impl<T, U> TryInto for T where U: TryFrom<T>,`

[src]

#### `type Error = <U as TryFrom<T>>::Error`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

####

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

[src]

🔬 This is a nightly-only experimental API. (`try_from`)

Performs the conversion.

###

`impl<T> BorrowMut for T where T: ?Sized,`

[src]

####
ⓘImportant traits for &'a mut R

### Important traits for &'a mut R

`impl<'a, R> Read for &'a mut R where
R: Read + ?Sized, impl<'a, W> Write for &'a mut W where
W: Write + ?Sized, impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;`

`fn borrow_mut(&mut self) -> &mut T`

[src]

Mutably borrows from an owned value. Read more

###

`impl<T> Any for T where T: 'static + ?Sized,`

[src]

####

`fn get_type_id(&self) -> TypeId`

[src]

🔬 This is a nightly-only experimental API. (`get_type_id`)

this method will likely be replaced by an associated static

Gets the `TypeId` of `self`. Read more

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)