Struct randomx_rs::RandomXVM [−][src]
pub struct RandomXVM { /* fields omitted */ }
Expand description
VM structure
Implementations
pub fn new(
flags: RandomXFlag,
cache: Option<&RandomXCache>,
dataset: Option<&RandomXDataset>
) -> Result<RandomXVM, RandomXError>
pub fn new(
flags: RandomXFlag,
cache: Option<&RandomXCache>,
dataset: Option<&RandomXDataset>
) -> Result<RandomXVM, RandomXError>
Creates a new VM
and initializes it, error on failure.
flags
is any combination of the following 5 flags:
- FLAG_LARGE_PAGES
- FLAG_HARD_AES
- FLAG_FULL_MEM
- FLAG_JIT
- FLAG_SECURE
Or
- FLAG_DEFAULT
cache
is a cache object, optional if FLAG_FULL_MEM is set.
dataset
is a dataset object, optional if FLAG_FULL_MEM is not set.
Re-initializes the VM
with a new cache that was initialised without
RandomXFlag::FLAG_FULL_MEM.
Re-initializes the VM
with a new dataset that was initialised with
RandomXFlag::FLAG_FULL_MEM.
Calculates a RandomX hash value and returns it, error on failure.
input
is a sequence of u8 to be hashed.