diff --git a/Cargo.lock b/Cargo.lock index c8b252f..8cc3281 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,7 +90,7 @@ checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "polldance" version = "0.1.0" -source = "git+https://git.asonix.dog/safe-async/polldance#cf88cef83966f8afcb9fff1f0fe840075fe53f2d" +source = "git+https://git.asonix.dog/safe-async/polldance#d6d08c8bce75cfea76063fe614a784a1dc058db6" dependencies = [ "rustix", ] diff --git a/src/io.rs b/src/io.rs index ab89e0d..f5977ee 100644 --- a/src/io.rs +++ b/src/io.rs @@ -165,6 +165,19 @@ impl Async { } .await } + + pub async fn connect_with_bind, B: Into>( + socket_address: A, + bind_address: Option, + ) -> Result> { + Connect { + io: Some( + polldance::net::TcpStream::connect_with_bind(socket_address, bind_address) + .map(Arc::new), + ), + } + .await + } } impl Async {