pub struct Hash {
pub data: [u8; 32],
}Fields§
§data: [u8; 32]Implementations§
Source§impl Hash
impl Hash
pub const ZERO: Hash
pub const fn from_byte_array(data: [u8; 32]) -> Hash
pub fn from_u256(val: U256) -> Hash
pub fn to_u256(self) -> U256
pub fn to_hex(&self) -> HexString<32>
pub fn abbreviate(&self) -> &[u8; 16]
pub fn from_hex(hex: impl AsRef<[u8]>) -> Result<Hash, FromHexError>
Trait Implementations§
Source§impl AsPrometheusLabel for Hash
impl AsPrometheusLabel for Hash
fn as_prometheus_str(&self) -> impl AsRef<str>
Source§impl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
Source§fn deserialize<D>(de: D) -> Result<Hash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(de: D) -> Result<Hash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given
deserializer.Source§impl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Hash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl GroundSpacetimeType for Hash
impl GroundSpacetimeType for Hash
Source§fn get_type() -> AlgebraicType
fn get_type() -> AlgebraicType
Returns the
AlgebraicType representation of Self.Source§impl Ord for Hash
impl Ord for Hash
Source§impl PartialOrd for Hash
impl PartialOrd for Hash
Source§impl Serialize for Hash
impl Serialize for Hash
Source§fn serialize<S>(
&self,
ser: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
ser: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize
self in the data format of S using the provided serializer.Source§impl Serialize for Hash
impl Serialize for Hash
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl SpacetimeType for Hash
impl SpacetimeType for Hash
Source§fn make_type<S>(_ts: &mut S) -> AlgebraicTypewhere
S: TypespaceBuilder,
fn make_type<S>(_ts: &mut S) -> AlgebraicTypewhere
S: TypespaceBuilder,
Returns an
AlgebraicType representing the type for Self in SATS
and in the typing context in typespace. This is used by the
automatic type registration system in Rust modules. Read moreimpl 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Col, Arg> IndexScanRangeBoundsTerminator for Argwhere
Arg: FilterableValue<Column = Col>,
impl<Col, Arg> IndexScanRangeBoundsTerminator for Argwhere
Arg: FilterableValue<Column = Col>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Satn for T
impl<T> Satn for T
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the value using the SATN data format into the formatter
f.Source§fn fmt_psql(
&self,
f: &mut Formatter<'_>,
ty: &PsqlType<'_>,
) -> Result<(), Error>
fn fmt_psql( &self, f: &mut Formatter<'_>, ty: &PsqlType<'_>, ) -> Result<(), Error>
Formats the value using the postgres SATN(PsqlFormatter { f }, /* PsqlType */) formatter
f.Source§fn to_satn(&self) -> String
fn to_satn(&self) -> String
Formats the value using the SATN data format into the returned
String.Source§fn to_satn_pretty(&self) -> String
fn to_satn_pretty(&self) -> String
Pretty prints the value using the SATN data format into the returned
String.