pub struct Work(/* private fields */);
Expand description
A 256 bit integer representing work.
Work is a measure of how difficult it is to find a hash below a given Target
.
Implementations§
Source§impl Work
impl Work
Sourcepub fn from_hex(s: &str) -> Result<Self, PrefixedHexError>
pub fn from_hex(s: &str) -> Result<Self, PrefixedHexError>
Creates Work
from a prefixed hex string.
Sourcepub fn from_unprefixed_hex(s: &str) -> Result<Self, UnprefixedHexError>
pub fn from_unprefixed_hex(s: &str) -> Result<Self, UnprefixedHexError>
Creates Work
from an unprefixed hex string.
Sourcepub fn from_be_bytes(bytes: [u8; 32]) -> Work
pub fn from_be_bytes(bytes: [u8; 32]) -> Work
Creates Work
from a big-endian byte array.
Sourcepub fn from_le_bytes(bytes: [u8; 32]) -> Work
pub fn from_le_bytes(bytes: [u8; 32]) -> Work
Creates Work
from a little-endian byte array.
Sourcepub fn to_be_bytes(self) -> [u8; 32]
pub fn to_be_bytes(self) -> [u8; 32]
Converts Work
to a big-endian byte array.
Sourcepub fn to_le_bytes(self) -> [u8; 32]
pub fn to_le_bytes(self) -> [u8; 32]
Converts Work
to a little-endian byte array.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Work
impl<'de> Deserialize<'de> for Work
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Work
impl Ord for Work
Source§impl PartialOrd for Work
impl PartialOrd for Work
impl Copy for Work
impl Eq for Work
impl StructuralPartialEq for Work
Auto Trait Implementations§
impl Freeze for Work
impl RefUnwindSafe for Work
impl Send for Work
impl Sync for Work
impl Unpin for Work
impl UnwindSafe for Work
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