Trait linera_views::views::HashableView

source ·
pub trait HashableView<C>: View<C> {
    type Hasher: Hasher;

    // Required methods
    fn hash_mut<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<<Self::Hasher as Hasher>::Output, ViewError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn hash<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<<Self::Hasher as Hasher>::Output, ViewError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A view that supports hashing its values.

Required Associated Types§

source

type Hasher: Hasher

How to compute hashes.

Required Methods§

source

fn hash_mut<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<<Self::Hasher as Hasher>::Output, ViewError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Computes the hash of the values.

Implementations do not need to include a type tag. However, the usual precautions to enforce collision resistance must be applied (e.g. including the length of a collection of values).

source

fn hash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<<Self::Hasher as Hasher>::Output, ViewError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Computes the hash of the values.

Implementations do not need to include a type tag. However, the usual precautions to enforce collision resistance must be applied (e.g. including the length of a collection of values).

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<C> HashableView<C> for KeyValueStoreView<C>
where C: Context + Send + Sync, ViewError: From<C::Error>,

source§

impl<C> HashableView<C> for ByteSetView<C>
where C: Context + Send + Sync, ViewError: From<C::Error>,

source§

impl<C, I> HashableView<C> for CustomSetView<C, I>

source§

impl<C, I> HashableView<C> for SetView<C, I>

source§

impl<C, I, V> HashableView<C> for CustomMapView<C, I, V>
where C: Context + Send + Sync, ViewError: From<C::Error>, I: Send + Sync + CustomSerialize, V: Clone + Send + Sync + Serialize + DeserializeOwned + 'static,

source§

impl<C, I, V> HashableView<C> for MapView<C, I, V>

source§

impl<C, I, W> HashableView<C> for CollectionView<C, I, W>
where C: Context + Send + Sync, ViewError: From<C::Error>, I: Clone + Send + Sync + Serialize + DeserializeOwned, W: HashableView<C> + Send + Sync + 'static,

source§

impl<C, I, W> HashableView<C> for CustomCollectionView<C, I, W>
where C: Context + Send + Sync, ViewError: From<C::Error>, I: Clone + Send + Sync + CustomSerialize, W: HashableView<C> + Send + Sync + 'static,

source§

impl<C, I, W> HashableView<C> for ReentrantCollectionView<C, I, W>
where C: Context + Send + Sync, ViewError: From<C::Error>, I: Send + Sync + Serialize + DeserializeOwned, W: HashableView<C> + Send + Sync + 'static,

source§

impl<C, I, W> HashableView<C> for ReentrantCustomCollectionView<C, I, W>
where C: Context + Send + Sync, ViewError: From<C::Error>, I: Send + Sync + CustomSerialize, W: HashableView<C> + Send + Sync + 'static,

source§

impl<C, T> HashableView<C> for LogView<C, T>

source§

impl<C, T> HashableView<C> for QueueView<C, T>

source§

impl<C, T> HashableView<C> for RegisterView<C, T>

source§

impl<C, T, const N: usize> HashableView<C> for BucketQueueView<C, T, N>

source§

impl<C, V> HashableView<C> for ByteMapView<C, V>
where C: Context + Send + Sync, ViewError: From<C::Error>, V: Clone + Send + Sync + Serialize + DeserializeOwned + 'static,

source§

impl<C, W> HashableView<C> for ByteCollectionView<C, W>
where C: Context + Send + Sync, ViewError: From<C::Error>, W: HashableView<C> + Send + Sync + 'static,

source§

impl<C, W> HashableView<C> for ReentrantByteCollectionView<C, W>
where C: Context + Send + Sync, ViewError: From<C::Error>, W: HashableView<C> + Send + Sync + 'static,

source§

impl<C, W, O> HashableView<C> for WrappedHashableContainerView<C, W, O>
where C: Context + Send + Sync, ViewError: From<C::Error>, W: HashableView<C> + Send + Sync, O: Serialize + DeserializeOwned + Send + Sync + Copy + PartialEq, W::Hasher: Hasher<Output = O>,

§

type Hasher = <W as HashableView<C>>::Hasher