xwt_tests/tests/
connect_rejected.rs1#[derive(Debug, thiserror::Error)]
5pub enum Error {
6 #[error("connect has not failed")]
7 ConnectDidNotFail,
8}
9
10pub async fn run<Endpoint>(endpoint: Endpoint, url: &str) -> Result<(), Error>
11where
12 Endpoint: xwt_core::endpoint::Connect + std::fmt::Debug,
13 Endpoint::Connecting: std::fmt::Debug,
14{
15 let result = crate::utils::connect(&endpoint, url).await;
16
17 let Err(error) = result else {
18 return Err(Error::ConnectDidNotFail);
19 };
20
21 tracing::info!(message = "the error on the rejected connect was", %error);
22
23 Ok(())
24}