linera_views::views

Trait 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).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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>,