pub struct ClientConnectionBuilder { /* private fields */ }Expand description
Builder for ClientConnection values.
Create one with ClientConfig::connect().
Implementations§
Source§impl ClientConnectionBuilder
impl ClientConnectionBuilder
Sourcepub fn with_alpn(
self,
alpn_protocols: Vec<ApplicationProtocol<'static>>,
) -> Self
pub fn with_alpn( self, alpn_protocols: Vec<ApplicationProtocol<'static>>, ) -> Self
Specify the ALPN protocols to use for this connection.
Sourcepub fn build(self, tls: &mut Vec<u8>) -> Result<ClientConnection, Error>
pub fn build(self, tls: &mut Vec<u8>) -> Result<ClientConnection, Error>
Finalize the builder and create the ClientConnection.
Sourcepub fn build_quic(
self,
version: Version,
params: Vec<u8>,
) -> Result<QuicClientConnection, Error>
pub fn build_quic( self, version: Version, params: Vec<u8>, ) -> Result<QuicClientConnection, Error>
Finalize the builder and create a QUIC ClientConnection.
This differs from ClientConnectionBuilder::build() in that it takes an extra params
argument, which contains the TLS-encoded transport parameters to send, and an extra
version argument, specifying the QUIC protocol version.
Sourcepub fn start_handshake(
self,
tls: &mut Vec<u8>,
) -> Result<NeedsInput<ClientSide>, Error>
pub fn start_handshake( self, tls: &mut Vec<u8>, ) -> Result<NeedsInput<ClientSide>, Error>
Finalize the builder and create a ClientHandshake.
It is a fundamental fact of client TLS connections that the client writes first; this data
is written to tls. The client then always reads the server’s response, as represented
by the NeedsInput return value.
You may wrap this in the ClientHandshake::NeedsInput variant to generalise the type to a
ClientHandshake.
The returned object should be fed data from a single server.