Struct grin_core::pow::Difficulty[][src]

pub struct Difficulty { /* fields omitted */ }

The difficulty is defined as the maximum target divided by the block hash.

Implementations

impl Difficulty[src]

pub fn zero() -> Difficulty[src]

Difficulty of zero, which is invalid (no target can be calculated from it) but very useful as a start for additions.

pub fn min_dma() -> Difficulty[src]

Difficulty of MIN_DIFFICULTY

pub fn min_wtema() -> Difficulty[src]

Difficulty of MIN_DIFFICULTY

pub fn unit() -> Difficulty[src]

Difficulty unit, which is the graph weight of minimal graph

pub fn from_num(num: u64) -> Difficulty[src]

Convert a u32 into a Difficulty

pub fn to_num(self) -> u64[src]

Converts the difficulty into a u64

impl Difficulty[src]

pub const LEN: usize[src]

Difficulty is 8 bytes.

Trait Implementations

impl Add<Difficulty> for Difficulty[src]

type Output = Difficulty

The resulting type after applying the + operator.

fn add(self, other: Difficulty) -> Difficulty[src]

Performs the + operation. Read more

impl Clone for Difficulty[src]

fn clone(&self) -> Difficulty[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Difficulty[src]

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

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for Difficulty[src]

fn deserialize<D>(deserializer: D) -> Result<Difficulty, D::Error> where
    D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Display for Difficulty[src]

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

Formats the value using the given formatter. Read more

impl Div<Difficulty> for Difficulty[src]

type Output = Difficulty

The resulting type after applying the / operator.

fn div(self, other: Difficulty) -> Difficulty[src]

Performs the / operation. Read more

impl Mul<Difficulty> for Difficulty[src]

type Output = Difficulty

The resulting type after applying the * operator.

fn mul(self, other: Difficulty) -> Difficulty[src]

Performs the * operation. Read more

impl Ord for Difficulty[src]

fn cmp(&self, other: &Difficulty) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl PartialEq<Difficulty> for Difficulty[src]

fn eq(&self, other: &Difficulty) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Difficulty) -> bool[src]

This method tests for !=.

impl PartialOrd<Difficulty> for Difficulty[src]

fn partial_cmp(&self, other: &Difficulty) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Readable for Difficulty[src]

fn read<R: Reader>(reader: &mut R) -> Result<Difficulty, Error>[src]

Reads the data necessary to this Readable from the provided reader

impl Serialize for Difficulty[src]

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
    S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl Sub<Difficulty> for Difficulty[src]

type Output = Difficulty

The resulting type after applying the - operator.

fn sub(self, other: Difficulty) -> Difficulty[src]

Performs the - operation. Read more

impl Writeable for Difficulty[src]

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>[src]

Write the data held by this Writeable to the provided writer

impl Copy for Difficulty[src]

impl Eq for Difficulty[src]

impl StructuralEq for Difficulty[src]

impl StructuralPartialEq for Difficulty[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> CloneAny for T where
    T: Any + Clone

pub fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>

pub fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send, Global> where
    T: Send

pub fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync, Global> where
    T: Sync

pub fn clone_any_send_sync(
    &self
) -> Box<dyn CloneAny + 'static + Sync + Send, Global> where
    T: Send + Sync

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> UnsafeAny for T where
    T: Any