Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ qevent = { path = "./qevent", version = "0.6.0" }
qudp = { path = "./qudp", version = "0.6.0" }
qinterface = { path = "./qinterface", version = "0.6.0" }
qdatagram = { path = "./qdatagram", version = "0.6.0" }
qresolve = { path = "./qresolve", version = "0.6.0" }
qresolve = { path = "./qresolve", version = "0.7.0-beta.1" }
qrecovery = { path = "./qrecovery", version = "0.6.0" }
qtraversal = { path = "./qtraversal", version = "0.6.0" }
qtraversal = { path = "./qtraversal", version = "0.7.0-beta.1" }
qcongestion = { path = "./qcongestion", version = "0.6.0" }
qconnection = { path = "./qconnection", version = "0.6.0" }
dquic = { path = "./dquic", version = "0.6.0" }
qconnection = { path = "./qconnection", version = "0.7.0-beta.1" }
dquic = { path = "./dquic", version = "0.7.0-beta.1" }
h3-shim = { path = "./h3-shim", version = "0.5.1" }


Expand Down
2 changes: 1 addition & 1 deletion dquic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dquic"
version = "0.6.0"
version = "0.7.0-beta.1"
edition.workspace = true
description = "An IETF quic transport protocol implemented natively using async Rust"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion qconnection/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "qconnection"
version = "0.6.0"
version = "0.7.0-beta.1"
edition.workspace = true
description = "Encapsulation of QUIC connections, a part of dquic"
readme.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion qresolve/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "qresolve"
version = "0.6.0"
version = "0.7.0-beta.1"
edition.workspace = true
description = "dquic's dns abstractions"
readme.workspace = true
Expand Down
30 changes: 27 additions & 3 deletions qresolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ pub use qbase::net::{Family, addr::EndpointAddr};
pub type PublishFuture<'a> = BoxFuture<'a, io::Result<()>>;

pub trait Publish: Any + Send + Sync + Display + Debug {
fn publish<'a>(&'a self, name: &'a str, packet: &'a [u8]) -> PublishFuture<'a>;
fn publish<'a>(
&'a self,
name: &'a str,
endpoints: &mut dyn Iterator<Item = EndpointAddr>,
) -> PublishFuture<'a>;
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
Expand Down Expand Up @@ -96,11 +100,31 @@ mod tests {
}

impl Publish for TestPublisher {
fn publish<'a>(&'a self, _name: &'a str, _packet: &'a [u8]) -> PublishFuture<'a> {
async { Ok(()) }.boxed()
fn publish<'a>(
&'a self,
name: &'a str,
endpoints: &mut dyn Iterator<Item = EndpointAddr>,
) -> PublishFuture<'a> {
let endpoints: Vec<_> = endpoints.collect();
async move {
assert_eq!(name, "demo.dhttp.net");
assert_eq!(endpoints.len(), 1);
Ok(())
}
.boxed()
}
}

#[test]
fn publish_trait_accepts_endpoint_iterator() {
let publisher: &dyn Publish = &TestPublisher;
let endpoint = EndpointAddr::direct("203.0.113.10:4433".parse().unwrap());
let mut endpoints = std::iter::once(endpoint);

futures::executor::block_on(publisher.publish("demo.dhttp.net", &mut endpoints))
.expect("publish succeeds");
}

fn assert_send_sync<T: Send + Sync>() {}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion qtraversal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "qtraversal"
version.workspace = true
version = "0.7.0-beta.1"
edition.workspace = true
description = "NAT traversal utilities for QUIC, a part of dquic"
readme = "README.md"
Expand Down
Loading