Skip to content

Commit ba1a800

Browse files
committed
Change DNS trait to return nb, and bump dependencies
1 parent 2ae093d commit ba1a800

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## Unreleased
99

10-
* None
10+
- Changed [`Dns`](./src/dns.rs) methods to return `nb::Result<..>` to allow non-blocking implementations.
11+
- Bump dependency version of `heapless` to `v0.6.1` to address security issue of sub-dependency.
12+
- Bump dependency version of `no-std-net` to `v0.5`.
13+
1114

1215
## [0.3.0] - 2021-02-15
1316

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ categories = ["embedded", "hardware-support", "no-std", "network-programming"]
1919

2020
[dependencies]
2121
nb = "1"
22-
no-std-net = "0.4"
23-
heapless = "^0.5"
22+
no-std-net = "0.5"
23+
heapless = "^0.6.1"

src/dns.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ pub trait Dns {
3131

3232
/// Resolve the first ip address of a host, given its hostname and a desired
3333
/// address record type to look for
34-
fn get_host_by_name(&self, hostname: &str, addr_type: AddrType) -> Result<IpAddr, Self::Error>;
34+
fn get_host_by_name(
35+
&self,
36+
hostname: &str,
37+
addr_type: AddrType,
38+
) -> nb::Result<IpAddr, Self::Error>;
3539

3640
/// Resolve the hostname of a host, given its ip address
3741
///
3842
/// **Note**: A fully qualified domain name (FQDN), has a maximum length of
3943
/// 255 bytes [`rfc1035`]
4044
///
4145
/// [`rfc1035`]: https://tools.ietf.org/html/rfc1035
42-
fn get_host_by_address(&self, addr: IpAddr) -> Result<String<consts::U256>, Self::Error>;
46+
fn get_host_by_address(&self, addr: IpAddr) -> nb::Result<String<consts::U256>, Self::Error>;
4347
}

0 commit comments

Comments
 (0)