Struct groestlcoin_hashes::sha256t::Hash
source · pub struct Hash<T: Tag>(/* private fields */);
Expand description
Output of the SHA256t hash function.
Implementations§
source§impl<T: Tag> Hash<T>
impl<T: Tag> Hash<T>
sourcepub fn forward_hex(&self) -> impl '_ + LowerHex + UpperHex
pub fn forward_hex(&self) -> impl '_ + LowerHex + UpperHex
Displays hex forwards, regardless of how this type would display it naturally.
This is mainly intended as an internal method and you shouldn’t need it unless you’re doing something special.
sourcepub fn backward_hex(&self) -> impl '_ + LowerHex + UpperHex
pub fn backward_hex(&self) -> impl '_ + LowerHex + UpperHex
Displays hex backwards, regardless of how this type would display it naturally.
This is mainly intended as an internal method and you shouldn’t need it unless you’re doing something special.
sourcepub fn from_bytes_ref(bytes: &[u8; 32]) -> &Self
pub fn from_bytes_ref(bytes: &[u8; 32]) -> &Self
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 Self
pub fn from_bytes_mut(bytes: &mut [u8; 32]) -> &mut Self
Zero cost conversion between a fixed length byte array exclusive reference and an exclusive reference to this Hash type.
Trait Implementations§
source§impl<'de, T: Tag> Deserialize<'de> for Hash<T>
impl<'de, T: Tag> Deserialize<'de> for Hash<T>
source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Hash<T>, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Hash<T>, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: Tag> Hash for Hash<T>
impl<T: Tag> Hash for Hash<T>
§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§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§fn from_engine(e: HashEngine) -> Hash<T>
fn from_engine(e: HashEngine) -> Hash<T>
Produces a hash from the current state of a given engine.
source§fn from_slice(sl: &[u8]) -> Result<Hash<T>, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<Hash<T>, FromSliceError>
Copies a byte slice into a hash object.
source§fn to_byte_array(self) -> Self::Bytes
fn to_byte_array(self) -> Self::Bytes
Returns the underlying byte array.
source§fn as_byte_array(&self) -> &Self::Bytes
fn as_byte_array(&self) -> &Self::Bytes
Returns a reference to the underlying byte array.
source§fn from_byte_array(bytes: Self::Bytes) -> Self
fn from_byte_array(bytes: Self::Bytes) -> Self
Constructs a hash from the underlying byte array.
source§impl<T: Tag> JsonSchema for Hash<T>
Available on crate feature schemars
only.
impl<T: Tag> JsonSchema for Hash<T>
Available on crate feature
schemars
only.source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<T: Tag> Ord for Hash<T>
impl<T: Tag> Ord for Hash<T>
source§impl<T: Tag> PartialEq for Hash<T>
impl<T: Tag> PartialEq for Hash<T>
source§impl<T: Tag> PartialOrd for Hash<T>
impl<T: Tag> PartialOrd for Hash<T>
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<T: Tag> SerdeHash for Hash<T>
impl<T: Tag> SerdeHash for Hash<T>
source§fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
Available on crate feature
serde
only.Helper function to turn a deserialized slice into the correct hash type.
source§fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>
fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>
Available on crate feature
serde
only.Do serde serialization.
source§fn deserialize<'de, D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<'de, D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Available on crate feature
serde
only.Do serde deserialization.
impl<T: Tag> Copy for Hash<T>
impl<T: Tag> Eq for Hash<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Hash<T>where
T: RefUnwindSafe,
impl<T> Send for Hash<T>where
T: Send,
impl<T> Sync for Hash<T>where
T: Sync,
impl<T> Unpin for Hash<T>where
T: Unpin,
impl<T> UnwindSafe for Hash<T>where
T: UnwindSafe,
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