pub struct Sha256d(/* private fields */);
Expand description
Output of the SHA256d hash function.
Implementations§
Source§impl Hash
impl Hash
Sourcepub fn from_bytes_ref(bytes: &[u8; 32]) -> &Hash
pub fn from_bytes_ref(bytes: &[u8; 32]) -> &Hash
Zero cost conversion between a fixed length byte array shared reference and a shared reference to this Hash type.
Sourcepub fn from_bytes_mut(bytes: &mut [u8; 32]) -> &mut Hash
pub fn from_bytes_mut(bytes: &mut [u8; 32]) -> &mut Hash
Zero cost conversion between a fixed length byte array exclusive reference and an exclusive reference to this Hash type.
Trait Implementations§
Source§impl Hash for Hash
impl Hash for Hash
Source§const DISPLAY_BACKWARD: bool = true
const DISPLAY_BACKWARD: bool = true
Flag indicating whether user-visible serializations of this hash
should be backward. For some reason Satoshi decided this should be
true for
Sha256dHash
, so here we are.Source§type Engine = HashEngine
type Engine = HashEngine
A hashing engine which bytes can be serialized into. It is expected
to implement the
io::Write
trait, and to never return errors under
any conditions.Source§fn from_engine(e: HashEngine) -> Hash
fn from_engine(e: HashEngine) -> Hash
Produces a hash from the current state of a given engine.
Source§fn from_slice(sl: &[u8]) -> Result<Hash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<Hash, FromSliceError>
Copies a byte slice into a hash object.
Source§fn as_byte_array(&self) -> &<Hash as Hash>::Bytes
fn as_byte_array(&self) -> &<Hash as Hash>::Bytes
Returns a reference to the underlying byte array.
Source§fn from_byte_array(bytes: <Hash as Hash>::Bytes) -> Hash
fn from_byte_array(bytes: <Hash as Hash>::Bytes) -> Hash
Constructs a hash from the underlying byte array.
Source§fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
Hashes all the byte slices retrieved from the iterator together.
Source§impl Ord for Hash
impl Ord for Hash
Source§impl PartialOrd for Hash
impl PartialOrd for Hash
impl Copy for Hash
impl Eq for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Freeze for Hash
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
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