Struct view::testutil::TestContext
source · [−]#[non_exhaustive]pub struct TestContext {
pub sender: ViewSender,
pub receiver: Receiver<ViewAction>,
}Expand description
Context for a ViewSender test.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sender: ViewSenderThe sender instance.
receiver: Receiver<ViewAction>The receiver instance.
Implementations
sourceimpl TestContext
impl TestContext
sourcepub fn drop_receiver(&mut self)
pub fn drop_receiver(&mut self)
Drop the receiver, useful for testing disconnect error handling.
sourcepub fn assert_render_action(&self, actions: &[&str])
pub fn assert_render_action(&self, actions: &[&str])
Assert that render actions were sent.
sourcepub fn assert_sent_messages(&self, messages: Vec<&str>)
pub fn assert_sent_messages(&self, messages: Vec<&str>)
Assert that certain messages were sent by the ViewSender.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for TestContext
impl Send for TestContext
impl Sync for TestContext
impl Unpin for TestContext
impl !UnwindSafe for TestContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more