Enum ckb_types::core::ScriptHashType
source · pub enum ScriptHashType {
Data = 0,
Type = 1,
Data1 = 2,
Data2 = 4,
}
Expand description
Specifies how the script code_hash
is used to match the script code and how to run the code.
The hash type is split into the high 7 bits and the low 1 bit,
when the low 1 bit is 1, it indicates the type,
when the low 1 bit is 0, it indicates the data,
and then it relies on the high 7 bits to indicate
that the data actually corresponds to the version.
Variants§
Data = 0
Type “data” matches script code via cell data hash, and run the script code in v0 CKB VM.
Type = 1
Type “type” matches script code via cell type script hash.
Data1 = 2
Type “data1” matches script code via cell data hash, and run the script code in v1 CKB VM.
Data2 = 4
Type “data2” matches script code via cell data hash, and run the script code in v2 CKB VM.
Trait Implementations§
source§impl Clone for ScriptHashType
impl Clone for ScriptHashType
source§fn clone(&self) -> ScriptHashType
fn clone(&self) -> ScriptHashType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ScriptHashType
impl Debug for ScriptHashType
source§impl Default for ScriptHashType
impl Default for ScriptHashType
source§fn default() -> ScriptHashType
fn default() -> ScriptHashType
Returns the “default value” for a type. Read more
source§impl Hash for ScriptHashType
impl Hash for ScriptHashType
source§impl Into<Byte> for ScriptHashType
impl Into<Byte> for ScriptHashType
source§impl Into<u8> for ScriptHashType
impl Into<u8> for ScriptHashType
source§impl PartialEq for ScriptHashType
impl PartialEq for ScriptHashType
source§impl TryFrom<Byte> for ScriptHashType
impl TryFrom<Byte> for ScriptHashType
source§type Error = OtherError
type Error = OtherError
The type returned in the event of a conversion error.
source§fn try_from(
v: Byte,
) -> Result<ScriptHashType, <ScriptHashType as TryFrom<Byte>>::Error>
fn try_from( v: Byte, ) -> Result<ScriptHashType, <ScriptHashType as TryFrom<Byte>>::Error>
Performs the conversion.
source§impl TryFrom<u8> for ScriptHashType
impl TryFrom<u8> for ScriptHashType
source§type Error = OtherError
type Error = OtherError
The type returned in the event of a conversion error.
source§fn try_from(
v: u8,
) -> Result<ScriptHashType, <ScriptHashType as TryFrom<u8>>::Error>
fn try_from( v: u8, ) -> Result<ScriptHashType, <ScriptHashType as TryFrom<u8>>::Error>
Performs the conversion.
impl Copy for ScriptHashType
impl Eq for ScriptHashType
impl StructuralPartialEq for ScriptHashType
Auto Trait Implementations§
impl Freeze for ScriptHashType
impl RefUnwindSafe for ScriptHashType
impl Send for ScriptHashType
impl Sync for ScriptHashType
impl Unpin for ScriptHashType
impl UnwindSafe for ScriptHashType
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
)