pub trait Hash: Send + Sync + Sized {
type Context: Send + Sync;
type Error: Error + Send + Sync;
fn hash<'life0, 'life1, 'async_trait>(
&'life0 self,
cxt: &'life1 Self::Context
) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn hash_owned<'life0, 'async_trait>(
self,
cxt: &'life0 Self::Context
) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn hash_hex<'life0, 'life1, 'async_trait>(
&'life0 self,
cxt: &'life1 Self::Context
) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
}
Expand description
Defines a standard hash for a scalar value.
Contextual information needed to access the data which this state contains.
Use () if there is no contextual data needed.
The type of error which may be returned when accessing this state’s data.
Use Infallible if there is no error to return.
Compute the SHA256 hash of this state.
Consume this state and compute its SHA256 hash.
Return the SHA256 hash of this state as a hexadecimal string.
impl<E, T0, T1, T2> Hash for (T0, T1, T2) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3> Hash for (T0, T1, T2, T3) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4> Hash for (T0, T1, T2, T3, T4) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5> Hash for (T0, T1, T2, T3, T4, T5) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5, T6> Hash for (T0, T1, T2, T3, T4, T5, T6) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
T6: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5, T6, T7> Hash for (T0, T1, T2, T3, T4, T5, T6, T7) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
T6: Hash<Context = (), Error = E>,
T7: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5, T6, T7, T8> Hash for (T0, T1, T2, T3, T4, T5, T6, T7, T8) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
T6: Hash<Context = (), Error = E>,
T7: Hash<Context = (), Error = E>,
T8: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Hash for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
T6: Hash<Context = (), Error = E>,
T7: Hash<Context = (), Error = E>,
T8: Hash<Context = (), Error = E>,
T9: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Hash for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
T6: Hash<Context = (), Error = E>,
T7: Hash<Context = (), Error = E>,
T8: Hash<Context = (), Error = E>,
T9: Hash<Context = (), Error = E>,
T10: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Hash for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
T6: Hash<Context = (), Error = E>,
T7: Hash<Context = (), Error = E>,
T8: Hash<Context = (), Error = E>,
T9: Hash<Context = (), Error = E>,
T10: Hash<Context = (), Error = E>,
T11: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Hash for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
T6: Hash<Context = (), Error = E>,
T7: Hash<Context = (), Error = E>,
T8: Hash<Context = (), Error = E>,
T9: Hash<Context = (), Error = E>,
T10: Hash<Context = (), Error = E>,
T11: Hash<Context = (), Error = E>,
T12: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Hash for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
T6: Hash<Context = (), Error = E>,
T7: Hash<Context = (), Error = E>,
T8: Hash<Context = (), Error = E>,
T9: Hash<Context = (), Error = E>,
T10: Hash<Context = (), Error = E>,
T11: Hash<Context = (), Error = E>,
T12: Hash<Context = (), Error = E>,
T13: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Hash for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
T6: Hash<Context = (), Error = E>,
T7: Hash<Context = (), Error = E>,
T8: Hash<Context = (), Error = E>,
T9: Hash<Context = (), Error = E>,
T10: Hash<Context = (), Error = E>,
T11: Hash<Context = (), Error = E>,
T12: Hash<Context = (), Error = E>,
T13: Hash<Context = (), Error = E>,
T14: Hash<Context = (), Error = E>,
impl<E, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Hash for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) where
E: Error + Send + Sync,
T0: Hash<Context = (), Error = E>,
T1: Hash<Context = (), Error = E>,
T2: Hash<Context = (), Error = E>,
T3: Hash<Context = (), Error = E>,
T4: Hash<Context = (), Error = E>,
T5: Hash<Context = (), Error = E>,
T6: Hash<Context = (), Error = E>,
T7: Hash<Context = (), Error = E>,
T8: Hash<Context = (), Error = E>,
T9: Hash<Context = (), Error = E>,
T10: Hash<Context = (), Error = E>,
T11: Hash<Context = (), Error = E>,
T12: Hash<Context = (), Error = E>,
T13: Hash<Context = (), Error = E>,
T14: Hash<Context = (), Error = E>,
T15: Hash<Context = (), Error = E>,