pub trait TestView: RootView<Context = MemoryContext<()>> + ClonableView {
type State: Debug + Eq + Send;
// Required methods
async fn stage_initial_changes(&mut self) -> Result<Self::State, ViewError>;
async fn stage_changes_to_be_discarded(
&mut self,
) -> Result<Self::State, ViewError>;
async fn stage_changes_to_be_persisted(
&mut self,
) -> Result<Self::State, ViewError>;
async fn read(&self) -> Result<Self::State, ViewError>;
}
Expand description
A View
to be used in test cases.
Required Associated Types§
Required Methods§
Sourceasync fn stage_initial_changes(&mut self) -> Result<Self::State, ViewError>
async fn stage_initial_changes(&mut self) -> Result<Self::State, ViewError>
Performs some initial changes to the view, staging them, and returning a representation of the view’s state.
Sourceasync fn stage_changes_to_be_discarded(
&mut self,
) -> Result<Self::State, ViewError>
async fn stage_changes_to_be_discarded( &mut self, ) -> Result<Self::State, ViewError>
Stages some changes to the view that won’t be persisted during the test.
Assumes that the current view state is the initially staged changes. Returns the updated state.
Sourceasync fn stage_changes_to_be_persisted(
&mut self,
) -> Result<Self::State, ViewError>
async fn stage_changes_to_be_persisted( &mut self, ) -> Result<Self::State, ViewError>
Stages some changes to the view that will be persisted during the test.
Assumes that the current view state is the initially staged changes. Returns the updated state.
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.