pub struct RandomXVM<T> { /* private fields */ }
Implementations§
Source§impl<T> RandomXVM<T>where
T: CacheRawAPI,
impl<T> RandomXVM<T>where
T: CacheRawAPI,
pub fn light(cache: T, flags: RandomXFlags) -> RResult<Self>
Sourcepub fn set_new_cache(&mut self, cache: &Cache)
pub fn set_new_cache(&mut self, cache: &Cache)
(from RandomX doc) Reinitializes a virtual machine with a new Cache. This function should be called anytime the Cache is reinitialized with a new key. Does nothing if called with a Cache containing the same key value as already set.
Source§impl<T> RandomXVM<T>where
T: DatasetRawAPI,
impl<T> RandomXVM<T>where
T: DatasetRawAPI,
pub fn fast(dataset: T, flags: RandomXFlags) -> RResult<Self>
Sourcepub fn set_new_dataset(&mut self, dataset: &Dataset)
pub fn set_new_dataset(&mut self, dataset: &Dataset)
Reinitializes a virtual machine with a new Dataset.
Source§impl<T> RandomXVM<T>
impl<T> RandomXVM<T>
Sourcepub fn hash(&self, local_nonce: &[u8]) -> ResultHash
pub fn hash(&self, local_nonce: &[u8]) -> ResultHash
Calculates a RandomX hash value.
Sourcepub fn hash_first(&self, local_nonce: &[u8])
pub fn hash_first(&self, local_nonce: &[u8])
Begins a RandomX hash calculation.
Sourcepub fn hash_next(&self, local_nonce: &[u8]) -> ResultHash
pub fn hash_next(&self, local_nonce: &[u8]) -> ResultHash
Output the hash value of the previous input and begin the calculation of the next hash.
Sourcepub fn hash_last(&self) -> ResultHash
pub fn hash_last(&self) -> ResultHash
Output the hash value of the previous input.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for RandomXVM<T>where
T: Freeze,
impl<T> RefUnwindSafe for RandomXVM<T>where
T: RefUnwindSafe,
impl<T> !Send for RandomXVM<T>
impl<T> !Sync for RandomXVM<T>
impl<T> Unpin for RandomXVM<T>where
T: Unpin,
impl<T> UnwindSafe for RandomXVM<T>where
T: UnwindSafe,
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