Skip to main content

open

Function open 

Source
pub async fn open(
    spec: &TransportSpec,
    versions: &SupportedVersions,
) -> Result<(Client, Arc<dyn ClientTransport>), ConnectError>
Expand description

Opens spec, negotiates, and binds the result.

Returns the transport alongside the client because several callers need it for something the client does not do — the bridge wraps it as a peer and forwards frames with it, where reading tools over it would be the wrong shape entirely. Handing back the same Arc the client holds is what keeps there from being two connections that could disagree about what was negotiated.

§Errors

ConnectError naming the stage that failed.