Struct spacetimedb_lib::Hash
source · pub struct Hash {
pub data: [u8; 32],
}Fields§
§data: [u8; 32]Implementations§
source§impl Hash
impl Hash
pub const ZERO: Hash = _
pub fn from_arr(arr: &[u8; 32]) -> Hash
pub fn from_slice(slice: &[u8]) -> Hash
pub fn to_vec(&self) -> Vec<u8>
pub fn to_hex(&self) -> HexString<32>
pub fn abbreviate(&self) -> &[u8; 16]
pub fn to_abbreviated_hex(&self) -> HexString<16>
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn from_hex(hex: impl AsRef<[u8]>) -> Result<Hash, FromHexError>
pub fn is_zero(&self) -> bool
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 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.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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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: &ProductType) -> Result<(), Error>
fn fmt_psql(&self, f: &mut Formatter<'_>, ty: &ProductType) -> Result<(), Error>
Formats the value using the postgres SATN(SatnFormatter { f }, /* AlgebraicType */) 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.