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§
sourcefn clone_unchecked(&mut self) -> Result<Self, ViewError>
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.