pub struct TestHelper { /* private fields */ }
Implementations§
Source§impl TestHelper
impl TestHelper
pub async fn begin_test( phy_config: WlantapPhyConfig, realm_config: WlanConfig, ) -> Self
pub async fn begin_test_with_context( ctx: Arc<TestRealmContext>, config: WlantapPhyConfig, ) -> Self
pub async fn begin_ap_test( phy_config: WlantapPhyConfig, network_config: NetworkConfigBuilder, realm_config: WlanConfig, ) -> Self
pub async fn begin_ap_test_with_context( ctx: Arc<TestRealmContext>, config: WlantapPhyConfig, network_config: NetworkConfigBuilder, ) -> Self
Sourcepub fn proxy(&self) -> Arc<WlantapPhyProxy>
pub fn proxy(&self) -> Arc<WlantapPhyProxy>
Returns a clone of the Arc<wlantap::WlantapPhyProxy>
as a convenience for passing
the proxy to futures. Tests must drop every Arc<wlantap::WlantapPhyProxy>
returned from this
method before dropping the TestHelper. Otherwise, TestHelper::drop() cannot synchronously
block on WlantapPhy.Shutdown().
pub fn test_ns_prefix(&self) -> &str
pub fn devfs(&self) -> &DirectoryProxy
pub async fn start_netdevice_session(&mut self, mac: MacAddr) -> (Session, Port)
Sourcepub async fn run_until_complete_or_timeout<H, F>(
&mut self,
timeout: MonotonicDuration,
context: impl Display,
handler: H,
future: F,
) -> F::Output
pub async fn run_until_complete_or_timeout<H, F>( &mut self, timeout: MonotonicDuration, context: impl Display, handler: H, future: F, ) -> F::Output
Will run the main future until it completes or when it has run past the specified duration. Note that any events that are observed on the event stream will be passed to the |event_handler| closure first before making progress on the main future. So if a test generates many events each of which requires significant computational time in the event handler, the main future may not be able to complete in time.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TestHelper
impl !RefUnwindSafe for TestHelper
impl Send for TestHelper
impl Sync for TestHelper
impl Unpin for TestHelper
impl !UnwindSafe for TestHelper
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