Index: Cargo.toml ================================================================== --- Cargo.toml +++ Cargo.toml @@ -1,8 +1,8 @@ [package] name = "protwrap" -version = "0.3.2" +version = "0.3.3" edition = "2021" license = "0BSD" # https://crates.io/category_slugs categories = [ "asynchronous", "network-programming" ] keywords = [ "network", "wrapper" ] Index: src/tokio/client/connector.rs ================================================================== --- src/tokio/client/connector.rs +++ src/tokio/client/connector.rs @@ -122,10 +122,26 @@ pub fn tls_tcp(s: &str) -> Result { Ok(Self::TlsTcp(TlsTcpConnInfo::from_str(s)?)) } } +impl Connector { + /// Return a displayable string representation of the `Connector`'s target + /// address. + /// + /// The returned string is not intended to be reversible. + #[must_use] + pub fn display_addr(&self) -> String { + match self { + Self::Tcp(ref tci) => tci.addr.clone(), + #[cfg(unix)] + Self::Uds(ref uci) => uci.fname.display().to_string(), + #[cfg(feature = "tls")] + Self::TlsTcp(ref ttci) => ttci.addr.clone() + } + } +} // ToDo: Add tls/tcp parameters parsing impl FromStr for Connector { type Err = Error; fn from_str(s: &str) -> Result { Index: www/changelog.md ================================================================== --- www/changelog.md +++ www/changelog.md @@ -2,18 +2,30 @@ ⚠️ indicates a breaking change. ## [Unreleased] -[Details](/vdiff?from=protwrap-0.3.2&to=trunk) +[Details](/vdiff?from=protwrap-0.3.3&to=trunk) ### Added ### Changed ### Removed +--- + +## [0.3.3] - 2024-10-18 + +[Details](/vdiff?from=protwrap-0.3.2&to=protwrap-0.3.3) + +### Added + +- Add `Connector::display_addr()` that can be used to acquire a `String` + representation of the `Connector`'s target address. The returned string is + intended for display/logging, and may not be reversible. + --- ## [0.3.2] - 2024-10-15 [Details](/vdiff?from=protwrap-0.3.1&to=protwrap-0.3.2) @@ -22,11 +34,11 @@ - Bug Fix: Fix Windows build. --- -## [0.3.1] - 2024-10-07 +## [0.3.1] (yanked) - 2024-10-07 [Details](/vdiff?from=protwrap-0.3.0&to=protwrap-0.3.1) ### Changed