Enum ckb_script::ScriptVersion 
source · pub enum ScriptVersion {
    V0 = 0,
    V1 = 1,
    V2 = 2,
}Expand description
The version of CKB Script Verifier.
Variants§
V0 = 0
CKB VM 0 with Syscall version 1.
V1 = 1
CKB VM 1 with Syscall version 1 and version 2.
V2 = 2
CKB VM 2 with Syscall version 1, version 2 and version 3.
Implementations§
source§impl ScriptVersion
 
impl ScriptVersion
sourcepub fn vm_version(self) -> VmVersion
 
pub fn vm_version(self) -> VmVersion
Returns the version of CKB VM in current script version.
sourcepub fn data_hash_type(self) -> ScriptHashType
 
pub fn data_hash_type(self) -> ScriptHashType
Returns the specific data script hash type.
Returns:
- ScriptHashType::Datafor version 0;
- ScriptHashType::Data1for version 1;
sourcepub fn init_core_machine_without_limit(self) -> CoreMachine
 
pub fn init_core_machine_without_limit(self) -> CoreMachine
Creates a CKB VM core machine without cycles limit.
In fact, there is still a limit of max_cycles which is set to 2^64-1.
sourcepub fn init_core_machine(self, max_cycles: Cycle) -> CoreMachine
 
pub fn init_core_machine(self, max_cycles: Cycle) -> CoreMachine
Creates a CKB VM core machine.
Trait Implementations§
source§impl Clone for ScriptVersion
 
impl Clone for ScriptVersion
source§fn clone(&self) -> ScriptVersion
 
fn clone(&self) -> ScriptVersion
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 ScriptVersion
 
impl Debug for ScriptVersion
source§impl Ord for ScriptVersion
 
impl Ord for ScriptVersion
source§fn cmp(&self, other: &ScriptVersion) -> Ordering
 
fn cmp(&self, other: &ScriptVersion) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for ScriptVersion
 
impl PartialEq for ScriptVersion
source§fn eq(&self, other: &ScriptVersion) -> bool
 
fn eq(&self, other: &ScriptVersion) -> bool
This method tests for 
self and other values to be equal, and is used
by ==.source§impl PartialOrd for ScriptVersion
 
impl PartialOrd for ScriptVersion
source§fn partial_cmp(&self, other: &ScriptVersion) -> Option<Ordering>
 
fn partial_cmp(&self, other: &ScriptVersion) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
 
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for 
self and other) and is used by the <=
operator. Read moreimpl Copy for ScriptVersion
impl Eq for ScriptVersion
impl StructuralPartialEq for ScriptVersion
Auto Trait Implementations§
impl Freeze for ScriptVersion
impl RefUnwindSafe for ScriptVersion
impl Send for ScriptVersion
impl Sync for ScriptVersion
impl Unpin for ScriptVersion
impl UnwindSafe for ScriptVersion
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> IntoEither for T
 
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more