Struct grin_core::pow::Difficulty
source · pub struct Difficulty { /* private fields */ }
Expand description
The difficulty is defined as the maximum target divided by the block hash.
Implementations§
source§impl Difficulty
impl Difficulty
sourcepub fn zero() -> Difficulty
pub fn zero() -> Difficulty
Difficulty of zero, which is invalid (no target can be calculated from it) but very useful as a start for additions.
sourcepub fn min_dma() -> Difficulty
pub fn min_dma() -> Difficulty
Difficulty of MIN_DIFFICULTY
sourcepub fn min_wtema() -> Difficulty
pub fn min_wtema() -> Difficulty
Difficulty of MIN_DIFFICULTY
sourcepub fn unit() -> Difficulty
pub fn unit() -> Difficulty
Difficulty unit, which is the graph weight of minimal graph
sourcepub fn from_num(num: u64) -> Difficulty
pub fn from_num(num: u64) -> Difficulty
Convert a u32
into a Difficulty
Trait Implementations§
source§impl Add for Difficulty
impl Add for Difficulty
§type Output = Difficulty
type Output = Difficulty
The resulting type after applying the
+
operator.source§fn add(self, other: Difficulty) -> Difficulty
fn add(self, other: Difficulty) -> Difficulty
Performs the
+
operation. Read moresource§impl Clone for Difficulty
impl Clone for Difficulty
source§fn clone(&self) -> Difficulty
fn clone(&self) -> Difficulty
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Difficulty
impl Debug for Difficulty
source§impl<'de> Deserialize<'de> for Difficulty
impl<'de> Deserialize<'de> for Difficulty
source§fn deserialize<D>(deserializer: D) -> Result<Difficulty, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Difficulty, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Difficulty
impl Display for Difficulty
source§impl Div for Difficulty
impl Div for Difficulty
§type Output = Difficulty
type Output = Difficulty
The resulting type after applying the
/
operator.source§fn div(self, other: Difficulty) -> Difficulty
fn div(self, other: Difficulty) -> Difficulty
Performs the
/
operation. Read moresource§impl Mul for Difficulty
impl Mul for Difficulty
§type Output = Difficulty
type Output = Difficulty
The resulting type after applying the
*
operator.source§fn mul(self, other: Difficulty) -> Difficulty
fn mul(self, other: Difficulty) -> Difficulty
Performs the
*
operation. Read moresource§impl Ord for Difficulty
impl Ord for Difficulty
source§fn cmp(&self, other: &Difficulty) -> Ordering
fn cmp(&self, other: &Difficulty) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for Difficulty
impl PartialEq for Difficulty
source§fn eq(&self, other: &Difficulty) -> bool
fn eq(&self, other: &Difficulty) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Difficulty
impl PartialOrd for Difficulty
source§fn partial_cmp(&self, other: &Difficulty) -> Option<Ordering>
fn partial_cmp(&self, other: &Difficulty) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Readable for Difficulty
impl Readable for Difficulty
source§impl Serialize for Difficulty
impl Serialize for Difficulty
source§impl Sub for Difficulty
impl Sub for Difficulty
§type Output = Difficulty
type Output = Difficulty
The resulting type after applying the
-
operator.source§fn sub(self, other: Difficulty) -> Difficulty
fn sub(self, other: Difficulty) -> Difficulty
Performs the
-
operation. Read moresource§impl Writeable for Difficulty
impl Writeable for Difficulty
impl Copy for Difficulty
impl Eq for Difficulty
impl StructuralPartialEq for Difficulty
Auto Trait Implementations§
impl Freeze for Difficulty
impl RefUnwindSafe for Difficulty
impl Send for Difficulty
impl Sync for Difficulty
impl Unpin for Difficulty
impl UnwindSafe for Difficulty
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.