Maybe BridgeAddr ought to be reworked
@nickm writes
It seems inaccurate to me to call this a
BridgeAddr
, since a bridge can also useChanMethod::Direct
, in which case it will not use this type.
@Diziet writes
[this type]'s most visible place after !874 (merged) (merged) is that it's the entry type for
BridgeConfigBuilder::addrs()
. You have to passBridgeAddr
to push. If you pass::None
, the entry is later filtered out, which is a bit anomalous. It's not clear that we need to (or ought to) support that (or its serde repr, which is putting"-"
in the addrs serde key).It's also in
ChannelMethod::Pluggable
, where it's the nominal host:port to pass to the PT. Here, None is parsed from"-"
and is meaningful.I'm inclined to think that we ought to generalise this, something like:
- Rename this type to something like
HostPort
and put it in tor-basic-utils- Abolish the
None
variant; instead, provide a parse_optional method or something. InPtTarget
, haveaddr: Option<HostPort>
.