pub struct TypeHash(/* private fields */);Expand description
A 256-bit type hash for Merkle tree-based type compatibility.
Implementations§
Source§impl TypeHash
impl TypeHash
Sourcepub fn from_bytes(bytes: [u8; 32]) -> Self
pub fn from_bytes(bytes: [u8; 32]) -> Self
Create from raw bytes.
Sourcepub fn from_u64s(a: u64, b: u64, c: u64, d: u64) -> Self
pub fn from_u64s(a: u64, b: u64, c: u64, d: u64) -> Self
Create from a tuple of 4 u64s (WASM representation).
Sourcepub fn to_short_hex(&self) -> String
pub fn to_short_hex(&self) -> String
Format as short hex (first 8 chars).
Sourcepub const fn from_bytes_const(bytes: [u8; 32]) -> Self
pub const fn from_bytes_const(bytes: [u8; 32]) -> Self
Const function to create from bytes (for compile-time constants).
Trait Implementations§
impl Copy for TypeHash
impl Eq for TypeHash
impl StructuralPartialEq for TypeHash
Auto Trait Implementations§
impl Freeze for TypeHash
impl RefUnwindSafe for TypeHash
impl Send for TypeHash
impl Sync for TypeHash
impl Unpin for TypeHash
impl UnsafeUnpin for TypeHash
impl UnwindSafe for TypeHash
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 more