Skip to main content

ClientConfig

Trait ClientConfig 

pub trait ClientConfig: Send + Sync {
    // Required methods
    fn start_session(
        self: Arc<Self>,
        version: Version,
        server_name: &str,
        params: &TransportParameters,
    ) -> Result<Box<dyn Session>, ConnectError>;
    fn supports_version_switch(&self) -> bool;
    fn resumable_version(&self, server_name: &str) -> Option<Version>;
}
Available on crate features quic and std only.
Expand description

Client-side configuration for the crypto protocol

Required Methods§

fn start_session( self: Arc<Self>, version: Version, server_name: &str, params: &TransportParameters, ) -> Result<Box<dyn Session>, ConnectError>

Start a client session with this configuration

fn supports_version_switch(&self) -> bool

Whether every session from this configuration can switch to a compatible version during the handshake. Decides at configuration time whether a version policy that needs a switch is usable.

fn resumable_version(&self, server_name: &str) -> Option<Version>

The version of the newest session ticket held for server_name, if the provider can tell without consuming it.

A ticket resumes only a connection in the version that issued it (RFC 9369 §5), so a client that wants to resume starts in that version.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§