pub struct TestEnv {
pub mocks: Mocks,
/* private fields */
}
Fields§
§mocks: Mocks
Implementations§
Source§impl TestEnv
impl TestEnv
Sourcepub fn connect_to_protocol<P: DiscoverableProtocolMarker>(&self) -> P::Proxy
pub fn connect_to_protocol<P: DiscoverableProtocolMarker>(&self) -> P::Proxy
Connects to a protocol exposed by a component within the RealmInstance.
pub fn connect_to_device<P: ProtocolMarker>( &self, driver_path: &str, ) -> P::Proxy
Sourcepub async fn connect_to_first_service_instance<S: ServiceMarker>(
&self,
marker: S,
) -> S::Proxy
pub async fn connect_to_first_service_instance<S: ServiceMarker>( &self, marker: S, ) -> S::Proxy
Connects to a protocol exposed by a component within the RealmInstance.
Sourcepub async fn destroy(&mut self)
pub async fn destroy(&mut self)
Destroys the TestEnv and underlying RealmInstance.
Every test that uses TestEnv must call this at the end of the test.
Sourcepub async fn set_temperature(&self, driver_path: &str, temperature: f32)
pub async fn set_temperature(&self, driver_path: &str, temperature: f32)
Sets the temperature for a mock temperature device.
pub async fn set_cpu_stats(&self, cpu_stats: CpuStats)
pub async fn wait_for_shutdown_request(&self)
pub async fn wait_for_device(&self, driver_path: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TestEnv
impl !RefUnwindSafe for TestEnv
impl Send for TestEnv
impl Sync for TestEnv
impl Unpin for TestEnv
impl !UnwindSafe for TestEnv
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