#[non_exhaustive]#[repr(u8)]pub enum OpCode {
Show 18 variants
PushBytes0,
PushBytes32,
Reserved,
Return,
PushData1,
PushData2,
PushData4,
PushNum1,
Dup,
Equal,
EqualVerify,
Ripemd160,
Sha1,
Sha256,
Hash160,
Hash256,
CheckSig,
CheckSigVerify,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PushBytes0
Push an empty array onto the stack.
PushBytes32
Push the next 32 bytes as an array onto the stack.
Reserved
Synonym for OP_RETURN.
Return
Fail the script immediately.
PushData1
Read the next byte as N; push the next N bytes as an array onto the stack.
PushData2
Read the next 2 bytes as N; push the next N bytes as an array onto the stack.
PushData4
Read the next 4 bytes as N; push the next N bytes as an array onto the stack.
PushNum1
Push the array 0x01 onto the stack.
Dup
Duplicates the top stack item.
Equal
Pushes 1 if the inputs are exactly equal, 0 otherwise.
EqualVerify
Returns success if the inputs are exactly equal, failure otherwise.
Ripemd160
Pop the top stack item and push its RIPEMD160 hash.
Sha1
Pop the top stack item and push its SHA1 hash.
Sha256
Pop the top stack item and push its SHA256 hash.
Hash160
Pop the top stack item and push its RIPEMD(SHA256) hash.
Hash256
Pop the top stack item and push its SHA256(SHA256) hash.
CheckSig
https://en.bitcoin.it/wiki/OP_CHECKSIG pushing 1/0 for success/failure.
CheckSigVerify
https://en.bitcoin.it/wiki/OP_CHECKSIG returning success/failure.
Trait Implementations§
source§impl PartialEq<OpCode> for OpCode
impl PartialEq<OpCode> 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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.