pub struct ConnectOptions { /* private fields */ }Expand description
Options for the Endpoint::connect_with_opts function.
Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default TransportConfig.
Sourcepub fn with_transport_config(
self,
transport_config: Arc<TransportConfig>,
) -> Self
pub fn with_transport_config( self, transport_config: Arc<TransportConfig>, ) -> Self
Sets the QUIC transport config options for this connection.
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
pub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your protocol. In this case, you would add the older ALPN identifiers with this function.
You’ll know the final negotiated ALPN identifier once your connection was
established using Connection::alpn, or even slightly earlier in the
handshake by using Connecting::alpn.
The negotiated ALPN identifier may be any of the ALPN identifiers in this
list or the main ALPN used in Endpoint::connect_with_opts.
The ALPN identifier order on the connect side doesn’t matter, since it’s the accept side that determines the protocol.
For setting the supported ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
fn clone(&self) -> ConnectOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more