pub struct TestHarness<D> { /* private fields */ }Expand description
The main test harness for running a driver unit test.
Implementations§
Source§impl<D: Driver> TestHarness<D>
impl<D: Driver> TestHarness<D>
Sourcepub fn set_driver_incoming(
self,
driver_incoming: ServiceFs<ServiceObj<'static, ()>>,
) -> Self
pub fn set_driver_incoming( self, driver_incoming: ServiceFs<ServiceObj<'static, ()>>, ) -> Self
Sets the driver incoming ServiceFs. Consumes and returns self to allow chaining.
Sourcepub fn set_config(self, config: Vmo) -> Self
pub fn set_config(self, config: Vmo) -> Self
Sets the configuration vmo for the driver. Consumes and returns self to allow chaining.
Sourcepub fn set_url(self, url: &str) -> Self
pub fn set_url(self, url: &str) -> Self
Sets the url for the driver. Consumes and returns self to allow chaining.
Sourcepub fn add_offer(self, offer: Offer) -> Self
pub fn add_offer(self, offer: Offer) -> Self
Adds an offer to the driver’s start args. Consumes and returns self to allow chaining.
Sourcepub fn dispatcher(&self) -> WeakDispatcher
pub fn dispatcher(&self) -> WeakDispatcher
Gets a driver dispatcher that can be used to run test side driver transport client/servers.
Sourcepub async fn start_driver(&mut self) -> Result<DriverUnderTest<'_, D>, Status>
pub async fn start_driver(&mut self) -> Result<DriverUnderTest<'_, D>, Status>
Starts the driver under test.
Trait Implementations§
Source§impl<D: Driver> Default for TestHarness<D>
impl<D: Driver> Default for TestHarness<D>
Auto Trait Implementations§
impl<D> Freeze for TestHarness<D>
impl<D> !RefUnwindSafe for TestHarness<D>
impl<D> Send for TestHarness<D>where
D: Send,
impl<D> !Sync for TestHarness<D>
impl<D> Unpin for TestHarness<D>where
D: Unpin,
impl<D> !UnwindSafe for TestHarness<D>
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
Mutably borrows from an owned value. Read more
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> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to SelfSource§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>
Converts
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>
Converts
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