Struct Cache

Source
pub struct Cache { /* private fields */ }

Implementations§

Source§

impl Cache

Source

pub fn new(global_nonce: &[u8], flags: RandomXFlags) -> RResult<Self>

Creates RandomX cache with the provided global_nonce. Flags is any combination of these 2 flags (each flag can be set or not set):

  • RANDOMX_FLAG_LARGE_PAGES - allocate memory in large pages
  • RANDOMX_FLAG_JIT - create cache structure with JIT compilation support; this makes subsequent Dataset initialization faster Optionally, one of these two flags may be selected:
  • RANDOMX_FLAG_ARGON2_SSSE3 - optimized Argon2 for CPUs with the SSSE3 instruction set makes subsequent cache initialization faster
  • RANDOMX_FLAG_ARGON2_AVX2 - optimized Argon2 for CPUs with the AVX2 instruction set makes subsequent cache initialization faster
Source

pub fn initialize(&mut self, global_nonce: &[u8])

Initializes the cache memory using the provided global nonce value. Does nothing if called with the same value again.

Source

pub fn handle(&self) -> CacheHandle

Trait Implementations§

Source§

impl CacheRawAPI for Cache

Source§

impl Debug for Cache

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Cache

§

impl RefUnwindSafe for Cache

§

impl Send for Cache

§

impl Sync for Cache

§

impl Unpin for Cache

§

impl UnwindSafe for Cache

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V