pub struct RandomxFlags { /* private fields */ }Expand description
Represents options that can be used when allocating the RandomX dataset or VM.
Implementations§
Source§impl RandomxFlags
impl RandomxFlags
Sourcepub const DEFAULT: RandomxFlags
pub const DEFAULT: RandomxFlags
Use defaults.
Sourcepub const LARGEPAGES: RandomxFlags
pub const LARGEPAGES: RandomxFlags
Allocate memory in large pages.
Sourcepub const HARDAES: RandomxFlags
pub const HARDAES: RandomxFlags
The RandomX VM will use hardware accelerated AES.
Sourcepub const FULLMEM: RandomxFlags
pub const FULLMEM: RandomxFlags
The RandomX VM will use the full dataset.
Sourcepub const JIT: RandomxFlags
pub const JIT: RandomxFlags
The RandomX VM will use a JIT compiler.
Sourcepub const SECURE: RandomxFlags
pub const SECURE: RandomxFlags
Make sure that JIT pages are never writable and executable at the same time.
Sourcepub const ARGON2_SSSE3: RandomxFlags
pub const ARGON2_SSSE3: RandomxFlags
Use the SSSE3 extension to speed up Argon2 operations.
Sourcepub const ARGON2_AVX2: RandomxFlags
pub const ARGON2_AVX2: RandomxFlags
Use the AVX2 extension to speed up Argon2 operations.
Sourcepub const ARGON2: RandomxFlags
pub const ARGON2: RandomxFlags
Do not use SSSE3 or AVX2 extensions.
Sourcepub const fn empty() -> RandomxFlags
pub const fn empty() -> RandomxFlags
Returns an empty set of flags
Sourcepub const fn all() -> RandomxFlags
pub const fn all() -> RandomxFlags
Returns the set containing all flags.
Sourcepub fn from_bits(bits: u32) -> Option<RandomxFlags>
pub fn from_bits(bits: u32) -> Option<RandomxFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u32) -> RandomxFlags
pub const fn from_bits_truncate(bits: u32) -> RandomxFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> RandomxFlags
pub const unsafe fn from_bits_unchecked(bits: u32) -> RandomxFlags
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Sourcepub const fn intersects(&self, other: RandomxFlags) -> bool
pub const fn intersects(&self, other: RandomxFlags) -> bool
Returns true if there are flags common to both self and other.
Sourcepub const fn contains(&self, other: RandomxFlags) -> bool
pub const fn contains(&self, other: RandomxFlags) -> bool
Returns true all of the flags in other are contained within self.
Sourcepub fn insert(&mut self, other: RandomxFlags)
pub fn insert(&mut self, other: RandomxFlags)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: RandomxFlags)
pub fn remove(&mut self, other: RandomxFlags)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: RandomxFlags)
pub fn toggle(&mut self, other: RandomxFlags)
Toggles the specified flags in-place.
Sourcepub fn set(&mut self, other: RandomxFlags, value: bool)
pub fn set(&mut self, other: RandomxFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations§
Source§impl Binary for RandomxFlags
impl Binary for RandomxFlags
Source§impl BitAnd for RandomxFlags
impl BitAnd for RandomxFlags
Source§fn bitand(self, other: RandomxFlags) -> RandomxFlags
fn bitand(self, other: RandomxFlags) -> RandomxFlags
Returns the intersection between the two sets of flags.
Source§type Output = RandomxFlags
type Output = RandomxFlags
& operator.Source§impl BitAndAssign for RandomxFlags
impl BitAndAssign for RandomxFlags
Source§fn bitand_assign(&mut self, other: RandomxFlags)
fn bitand_assign(&mut self, other: RandomxFlags)
Disables all flags disabled in the set.
Source§impl BitOr for RandomxFlags
impl BitOr for RandomxFlags
Source§fn bitor(self, other: RandomxFlags) -> RandomxFlags
fn bitor(self, other: RandomxFlags) -> RandomxFlags
Returns the union of the two sets of flags.
Source§type Output = RandomxFlags
type Output = RandomxFlags
| operator.Source§impl BitOrAssign for RandomxFlags
impl BitOrAssign for RandomxFlags
Source§fn bitor_assign(&mut self, other: RandomxFlags)
fn bitor_assign(&mut self, other: RandomxFlags)
Adds the set of flags.
Source§impl BitXor for RandomxFlags
impl BitXor for RandomxFlags
Source§fn bitxor(self, other: RandomxFlags) -> RandomxFlags
fn bitxor(self, other: RandomxFlags) -> RandomxFlags
Returns the left flags, but with all the right flags toggled.
Source§type Output = RandomxFlags
type Output = RandomxFlags
^ operator.Source§impl BitXorAssign for RandomxFlags
impl BitXorAssign for RandomxFlags
Source§fn bitxor_assign(&mut self, other: RandomxFlags)
fn bitxor_assign(&mut self, other: RandomxFlags)
Toggles the set of flags.
Source§impl Clone for RandomxFlags
impl Clone for RandomxFlags
Source§fn clone(&self) -> RandomxFlags
fn clone(&self) -> RandomxFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RandomxFlags
impl Debug for RandomxFlags
Source§impl Default for RandomxFlags
impl Default for RandomxFlags
Source§fn default() -> RandomxFlags
fn default() -> RandomxFlags
Get the recommended flags to use on the current machine.
Does not include any of the following flags:
- LARGEPAGES
- JIT
- SECURE
Source§impl Extend<RandomxFlags> for RandomxFlags
impl Extend<RandomxFlags> for RandomxFlags
Source§fn extend<T: IntoIterator<Item = RandomxFlags>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = RandomxFlags>>(&mut self, iterator: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl FromIterator<RandomxFlags> for RandomxFlags
impl FromIterator<RandomxFlags> for RandomxFlags
Source§fn from_iter<T: IntoIterator<Item = RandomxFlags>>(iterator: T) -> RandomxFlags
fn from_iter<T: IntoIterator<Item = RandomxFlags>>(iterator: T) -> RandomxFlags
Source§impl Hash for RandomxFlags
impl Hash for RandomxFlags
Source§impl LowerHex for RandomxFlags
impl LowerHex for RandomxFlags
Source§impl Not for RandomxFlags
impl Not for RandomxFlags
Source§fn not(self) -> RandomxFlags
fn not(self) -> RandomxFlags
Returns the complement of this set of flags.
Source§type Output = RandomxFlags
type Output = RandomxFlags
! operator.Source§impl Octal for RandomxFlags
impl Octal for RandomxFlags
Source§impl Ord for RandomxFlags
impl Ord for RandomxFlags
Source§fn cmp(&self, other: &RandomxFlags) -> Ordering
fn cmp(&self, other: &RandomxFlags) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RandomxFlags
impl PartialEq for RandomxFlags
Source§impl PartialOrd for RandomxFlags
impl PartialOrd for RandomxFlags
Source§impl Sub for RandomxFlags
impl Sub for RandomxFlags
Source§fn sub(self, other: RandomxFlags) -> RandomxFlags
fn sub(self, other: RandomxFlags) -> RandomxFlags
Returns the set difference of the two sets of flags.
Source§type Output = RandomxFlags
type Output = RandomxFlags
- operator.Source§impl SubAssign for RandomxFlags
impl SubAssign for RandomxFlags
Source§fn sub_assign(&mut self, other: RandomxFlags)
fn sub_assign(&mut self, other: RandomxFlags)
Disables all flags enabled in the set.