pub struct TestController<'test_refs> { /* private fields */ }
Expand description
test_server_client
and test_client
allow for a “coordinator” closure - something
responsible for coordinating test execution. In particular in certain tests it is important to
make sure all the operations have completed before running the next portion of the test.
This type represents a controller that the coordinator uses to achieve this effect.
Coordinator will use oneshot
or mpsc
channels to synchronize with the test execution and
will call TestController::run_until_stalled()
to separate portions of the test, optinally
followed by TestController::run_until_complete()
. In any case, TestController
will
ensure that the test execution
finishes completely, not just stalls.
Implementations§
Source§impl<'test_refs> TestController<'test_refs>
impl<'test_refs> TestController<'test_refs>
Sourcepub fn run_until_stalled(&mut self)
pub fn run_until_stalled(&mut self)
Runs the client test code until it is stalled. Will panic if the test code runs to completion.
Sourcepub fn run_until_complete(self)
pub fn run_until_complete(self)
Runs the client test code to completion. As this will consume the controller, this method can only be called last. Note that the controller will effectively run this methods for you when it is dropped, if you do not do it explicitly.
Trait Implementations§
Auto Trait Implementations§
impl<'test_refs> Freeze for TestController<'test_refs>
impl<'test_refs> !RefUnwindSafe for TestController<'test_refs>
impl<'test_refs> !Send for TestController<'test_refs>
impl<'test_refs> !Sync for TestController<'test_refs>
impl<'test_refs> Unpin for TestController<'test_refs>
impl<'test_refs> !UnwindSafe for TestController<'test_refs>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more