Trait linera_views::views::ClonableView

source ·
pub trait ClonableView<C>: View<C> {
    // Required method
    fn clone_unchecked(&mut self) -> Result<Self, ViewError>;
}
Expand description

A ClonableView supports being shared (unsafely) by cloning it.

Sharing is unsafe because by having two view instances for the same data, they may have invalid state if both are used for writing.

Sharing the view is guaranteed to not cause data races if only one of the shared view instances is used for writing at any given point in time.

Required Methods§

source

fn clone_unchecked(&mut self) -> Result<Self, ViewError>

Creates a clone of this view, sharing the underlying storage context but prone to data races which can corrupt the view state.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<C> ClonableView<C> for TestBucketQueueView<C>
where C: Context + Send + Sync + Clone + 'static,

source§

impl<C> ClonableView<C> for TestCollectionView<C>
where C: Context + Send + Sync + Clone + 'static,

source§

impl<C> ClonableView<C> for TestLogView<C>
where C: Context + Send + Sync + Clone + 'static,

source§

impl<C> ClonableView<C> for TestMapView<C>
where C: Context + Send + Sync + Clone + 'static,

source§

impl<C> ClonableView<C> for TestQueueView<C>
where C: Context + Send + Sync + Clone + 'static,

source§

impl<C> ClonableView<C> for TestRegisterView<C>
where C: Context + Send + Sync + Clone + 'static,

source§

impl<C> ClonableView<C> for TestSetView<C>
where C: Context + Send + Sync + Clone + 'static,

source§

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

source§

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

source§

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

source§

impl<C, I> ClonableView<C> for SetView<C, I>
where C: Context + Send + Sync, ViewError: From<C::Error>, I: Send + Sync + Serialize,

source§

impl<C, I, V> ClonableView<C> for CustomMapView<C, I, V>

source§

impl<C, I, V> ClonableView<C> for MapView<C, I, V>
where C: Context + Send + Sync, ViewError: From<C::Error>, I: Sync, V: Clone + Send + Sync + Serialize,

source§

impl<C, I, W> ClonableView<C> for CollectionView<C, I, W>

source§

impl<C, I, W> ClonableView<C> for CustomCollectionView<C, I, W>
where C: Context + Send + Sync, ViewError: From<C::Error>, I: Send + Sync, W: ClonableView<C> + Send + Sync,

source§

impl<C, I, W> ClonableView<C> for ReentrantCollectionView<C, I, W>

source§

impl<C, I, W> ClonableView<C> for ReentrantCustomCollectionView<C, I, W>

source§

impl<C, T> ClonableView<C> for LogView<C, T>
where C: Context + Send + Sync, ViewError: From<C::Error>, T: Clone + Send + Sync + Serialize,

source§

impl<C, T> ClonableView<C> for QueueView<C, T>
where C: Context + Send + Sync, ViewError: From<C::Error>, T: Clone + Send + Sync + Serialize,

source§

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

source§

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

source§

impl<C, V> ClonableView<C> for ByteMapView<C, V>
where C: Context + Send + Sync, ViewError: From<C::Error>, V: Clone + Send + Sync + Serialize,

source§

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

source§

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

source§

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