Struct ccp_randomx::dataset::Dataset
source · pub struct Dataset { /* private fields */ }Implementations§
source§impl Dataset
impl Dataset
sourcepub fn new(global_nonce: &[u8], flags: RandomXFlags) -> RResult<Self>
pub fn new(global_nonce: &[u8], flags: RandomXFlags) -> RResult<Self>
Allocate and initialize a new database with provided global nonce and flags. Only RANDOMX_FLAG_LARGE_PAGES is supported (can be set or unset), it forces memory allocation in large pages.
sourcepub fn from_cache(cache: &Cache, large_pages_enabled: bool) -> RResult<Self>
pub fn from_cache(cache: &Cache, large_pages_enabled: bool) -> RResult<Self>
Allocate and initialize a new database with the provided cache, large_pages_enabled forces it to allocate memory in large pages.
sourcepub fn allocate(large_pages_enabled: bool) -> RResult<Self>
pub fn allocate(large_pages_enabled: bool) -> RResult<Self>
Allocate a new dataset, but doesn’t initialize it.
sourcepub fn items_count(&self) -> u64
pub fn items_count(&self) -> u64
Return a number of elements that a dataset could contain.
sourcepub fn initialize(
&mut self,
cache: &impl CacheRawAPI,
start_item: u64,
items_count: u64
)
pub fn initialize( &mut self, cache: &impl CacheRawAPI, start_item: u64, items_count: u64 )
Initialize dataset with the provided cache.
pub fn handle(&self) -> DatasetHandle
Trait Implementations§
source§impl DatasetRawAPI for Dataset
impl DatasetRawAPI for Dataset
fn raw(&self) -> *mut randomx_dataset
Auto Trait Implementations§
impl RefUnwindSafe for Dataset
impl Send for Dataset
impl Sync for Dataset
impl Unpin for Dataset
impl UnwindSafe for Dataset
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