[−][src]Struct grin_core::pow::Difficulty
The difficulty is defined as the maximum target divided by the block hash.
Methods
impl Difficulty
[src]
impl Difficulty
pub fn zero() -> Difficulty
[src]
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.
pub fn one() -> Difficulty
[src]
pub fn one() -> Difficulty
Difficulty of one, which is the minimum difficulty (when the hash equals the max target)
pub fn from_num(num: u64) -> Difficulty
[src]
pub fn from_num(num: u64) -> Difficulty
Convert a u32
into a Difficulty
pub fn to_num(&self) -> u64
[src]
pub fn to_num(&self) -> u64
Converts the difficulty into a u64
Trait Implementations
impl Writeable for Difficulty
[src]
impl Writeable for Difficulty
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
[src]
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
Write the data held by this Writeable to the provided writer
impl Readable for Difficulty
[src]
impl Readable for Difficulty
fn read(reader: &mut dyn Reader) -> Result<Difficulty, Error>
[src]
fn read(reader: &mut dyn Reader) -> Result<Difficulty, Error>
Reads the data necessary to this Readable from the provided reader
impl PartialOrd<Difficulty> for Difficulty
[src]
impl PartialOrd<Difficulty> for Difficulty
fn partial_cmp(&self, other: &Difficulty) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Difficulty) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Difficulty) -> bool
[src]
fn lt(&self, other: &Difficulty) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Difficulty) -> bool
[src]
fn le(&self, other: &Difficulty) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Difficulty) -> bool
[src]
fn gt(&self, other: &Difficulty) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Difficulty) -> bool
[src]
fn ge(&self, other: &Difficulty) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Difficulty
[src]
impl Ord for Difficulty
fn cmp(&self, other: &Difficulty) -> Ordering
[src]
fn cmp(&self, other: &Difficulty) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl PartialEq<Difficulty> for Difficulty
[src]
impl PartialEq<Difficulty> for Difficulty
fn eq(&self, other: &Difficulty) -> bool
[src]
fn eq(&self, other: &Difficulty) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Difficulty) -> bool
[src]
fn ne(&self, other: &Difficulty) -> bool
This method tests for !=
.
impl Clone for Difficulty
[src]
impl Clone for Difficulty
fn clone(&self) -> Difficulty
[src]
fn clone(&self) -> Difficulty
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Difficulty
[src]
impl Copy for Difficulty
impl Eq for Difficulty
[src]
impl Eq for Difficulty
impl Debug for Difficulty
[src]
impl Debug for Difficulty
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for Difficulty
[src]
impl Display for Difficulty
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Sub<Difficulty> for Difficulty
[src]
impl Sub<Difficulty> for Difficulty
type Output = Difficulty
The resulting type after applying the -
operator.
fn sub(self, other: Difficulty) -> Difficulty
[src]
fn sub(self, other: Difficulty) -> Difficulty
Performs the -
operation.
impl Add<Difficulty> for Difficulty
[src]
impl Add<Difficulty> for Difficulty
type Output = Difficulty
The resulting type after applying the +
operator.
fn add(self, other: Difficulty) -> Difficulty
[src]
fn add(self, other: Difficulty) -> Difficulty
Performs the +
operation.
impl Mul<Difficulty> for Difficulty
[src]
impl Mul<Difficulty> for Difficulty
type Output = Difficulty
The resulting type after applying the *
operator.
fn mul(self, other: Difficulty) -> Difficulty
[src]
fn mul(self, other: Difficulty) -> Difficulty
Performs the *
operation.
impl Div<Difficulty> for Difficulty
[src]
impl Div<Difficulty> for Difficulty
type Output = Difficulty
The resulting type after applying the /
operator.
fn div(self, other: Difficulty) -> Difficulty
[src]
fn div(self, other: Difficulty) -> Difficulty
Performs the /
operation.
impl<'de> Deserialize<'de> for Difficulty
[src]
impl<'de> Deserialize<'de> for Difficulty
fn deserialize<D>(deserializer: D) -> Result<Difficulty, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Difficulty, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Serialize for Difficulty
[src]
impl Serialize for Difficulty
Auto Trait Implementations
impl Send for Difficulty
impl Send for Difficulty
impl Sync for Difficulty
impl Sync for Difficulty
Blanket Implementations
impl<W> Hashed for W where
W: Writeable,
[src]
impl<W> Hashed for W where
W: Writeable,
fn hash(&Self) -> Hash
[src]
fn hash(&Self) -> Hash
Obtain the hash of the object
fn hash_with<T>(&Self, T) -> Hash where
T: Writeable,
[src]
fn hash_with<T>(&Self, T) -> Hash where
T: Writeable,
Hash the object together with another writeable object
impl<H> ShortIdentifiable for H where
H: Hashed,
[src]
impl<H> ShortIdentifiable for H where
H: Hashed,
fn short_id(&Self, &Hash, u64) -> ShortId
[src]
fn short_id(&Self, &Hash, u64) -> ShortId
Generate a short_id via the following -
- extract k0/k1 from block_hash hashed with the nonce (first two u64
values) * initialize a siphasher24 with k0/k1
- self.hash() passing in the siphasher24 instance
- drop the 2 most significant bytes (to return a 6 byte short_id)
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 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> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
impl<T> CloneAny for T where
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,
impl<T> Erased for T
impl<T> Erased for T
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self