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 Freeze for Dataset
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