-
Notifications
You must be signed in to change notification settings - Fork 265
Open
Description
Endpoint::conn_type(node_id: NodeId) -> anyhow::Result<Watcher<ConnectionType>>
This is a bad API:
- The
Result
is only error when the node_id does not exist. Normally rust uses anOption
for this case though. - Whether the endpoint knows about a NodeId or not is entirely out of control of the caller.
- The endpoint might forget a NodeId, if you have a life watcher at this time you would get
ConnectionType::None
and then the watcher would be pending until the endpoint knows about the NodeId again. Why does this behave differently then when calling it?
So potentially this should be infallible and return ConnectionType::None
for unknown NodeId
s?
Also, the name is terrible. #2806 (comment) suggests fn network_path(node_id: NodeId) -> Watcher<NetworkPath>
.
matheus23
Metadata
Metadata
Assignees
Type
Projects
Status
No status