pub async fn connect_with_psks(
config: ClientConfig,
sink: Box<dyn Sink>,
psks: Vec<StoredPsk>,
) -> Result<(ClientHandle, EventStream)>Expand description
Connects with pairing keys the host stores for known servers.
The server announces a psk_id and psk_category in Noise message 1. A candidate matches when
its category and derived id both match the announcement; its server_id must then equal the one
in server/init. On a lookup miss the initial handshake continues with the published Sentinel
key, which is why connect is the same call with no candidates.
The keys are used for the handshake only; they are not stored or logged. A reconnect uses them
again, so a pairing that worked keeps working. A Storage configured
on config joins them: its records are read for every attempt, and on the same server_id the
stored record wins over explicit, because the store is the authority for the servers it knows.
The pairing PSK the store holds is always a candidate as well, whether or not a pairing is
running.
§Errors
Same as connect. A record that belongs to another server fails the handshake of that
attempt and is reported as Event::Disconnected. A store that cannot be read or cannot hold
the pairing PSK is reported from this call before the first attempt. A configuration with a
store makes the client draw and persist its pairing PSK on a device’s first run.