#[non_exhaustive]#[repr(u8)]pub enum OpCode {
Show 18 variants
PushBytes0 = 0,
PushBytes32 = 32,
Reserved = 80,
Return = 106,
PushData1 = 76,
PushData2 = 77,
PushData4 = 78,
PushNum1 = 81,
Dup = 118,
Equal = 135,
EqualVerify = 136,
Ripemd160 = 166,
Sha1 = 167,
Sha256 = 168,
Hash160 = 169,
Hash256 = 170,
CheckSig = 172,
CheckSigVerify = 173,
}
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PushBytes0 = 0
Push an empty array onto the stack.
PushBytes32 = 32
Push the next 32 bytes as an array onto the stack.
Reserved = 80
Synonym for OP_RETURN.
Return = 106
Fail the script immediately.
PushData1 = 76
Read the next byte as N; push the next N bytes as an array onto the stack.
PushData2 = 77
Read the next 2 bytes as N; push the next N bytes as an array onto the stack.
PushData4 = 78
Read the next 4 bytes as N; push the next N bytes as an array onto the stack.
PushNum1 = 81
Push the array 0x01
onto the stack.
Dup = 118
Duplicates the top stack item.
Equal = 135
Pushes 1 if the inputs are exactly equal, 0 otherwise.
EqualVerify = 136
Returns success if the inputs are exactly equal, failure otherwise.
Ripemd160 = 166
Pop the top stack item and push its RIPEMD160 hash.
Sha1 = 167
Pop the top stack item and push its SHA1 hash.
Sha256 = 168
Pop the top stack item and push its SHA256 hash.
Hash160 = 169
Pop the top stack item and push its RIPEMD(SHA256) hash.
Hash256 = 170
Pop the top stack item and push its SHA256(SHA256) hash.
CheckSig = 172
https://en.bitcoin.it/wiki/OP_CHECKSIG pushing 1/0 for success/failure.
CheckSigVerify = 173
https://en.bitcoin.it/wiki/OP_CHECKSIG returning success/failure.
Trait Implementations§
source§impl PartialEq for OpCode
impl PartialEq for OpCode
source§impl StrictDecode for OpCode
impl StrictDecode for OpCode
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(lim: usize, reader: impl Read) -> Result<Self, DecodeError>
source§impl StrictDumb for OpCode
impl StrictDumb for OpCode
fn strict_dumb() -> Self
source§impl StrictEncode for OpCode
impl StrictEncode for OpCode
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, lim: usize, writer: impl Write) -> Result<usize, Error>
source§impl StrictEnum for OpCode
impl StrictEnum for OpCode
fn from_variant_name(name: &FieldName) -> Result<Self, VariantError<&FieldName>>
fn strict_type_info() -> TypeInfo<Self>
source§impl StrictSum for OpCode
impl StrictSum for OpCode
const ALL_VARIANTS: &'static [(u8, &'static str)] = _
fn variant_name(&self) -> &'static str
fn strict_check_variants()
fn variant_name_by_tag(tag: u8) -> Option<FieldName>
fn variant_ord(&self) -> u8
source§impl StrictType for OpCode
impl StrictType for OpCode
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
impl Copy for OpCode
impl Eq for OpCode
impl StructuralEq for OpCode
impl StructuralPartialEq for OpCode
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.