pub fn new(version: u32) -> Result<Config> {
        if !is_reserved_version(version) && !version_is_supported(version) {
            return Err(Error::UnknownVersion);
        }

        let tls_ctx = Mutex::new(tls::Context::new()?);

        Ok(Config {
            local_transport_params: TransportParams::default(),
            version,
            tls_ctx,
            application_protos: Vec::new(),
            grease: true,
            cc_algorithm: CongestionControlAlgorithm::CUBIC,
            hystart: true,

            dgram_recv_max_queue_len: DEFAULT_MAX_DGRAM_QUEUE_LEN,
            dgram_send_max_queue_len: DEFAULT_MAX_DGRAM_QUEUE_LEN,

            max_send_udp_payload_size: MAX_SEND_UDP_PAYLOAD_SIZE,
        })
    }
/// Creates a config object with the given version.
///
/// ## Examples:
///
/// ```
/// let config = quiche::Config::new(quiche::PROTOCOL_VERSION)?;
/// # Ok::<(), quiche::Error>(())
/// ```
Creates a config object with the given version.
Creates a config object with the given version .
pub fn new(version: u32) -> Result<Config> {
        if !is_reserved_version(version) && !version_is_supported(version) {
            return Err(Error::UnknownVersion);
        }
        let tls_ctx = Mutex::new(tls::Context::new()?);
        Ok(Config {
            local_transport_params: TransportParams::default(),
            version,
            tls_ctx,
            application_protos: Vec::new(),
            grease: true,
            cc_algorithm: CongestionControlAlgorithm::CUBIC,
            hystart: true,
            dgram_recv_max_queue_len: DEFAULT_MAX_DGRAM_QUEUE_LEN,
            dgram_send_max_queue_len: DEFAULT_MAX_DGRAM_QUEUE_LEN,
            max_send_udp_payload_size: MAX_SEND_UDP_PAYLOAD_SIZE,
        })
    }
pub fn new ( version : u32 ) -> Result < Config > { if ! is_reserved_version ( version ) && ! version_is_supported ( version ) { return Err ( Error :: UnknownVersion ) ; } let tls_ctx = Mutex :: new ( tls :: Context :: new ( ) ? ) ; Ok ( Config { local_transport_params : TransportParams :: default ( ) , version , tls_ctx , application_protos : Vec :: new ( ) , grease : true , cc_algorithm : CongestionControlAlgorithm :: CUBIC , hystart : true , dgram_recv_max_queue_len : DEFAULT_MAX_DGRAM_QUEUE_LEN , dgram_send_max_queue_len : DEFAULT_MAX_DGRAM_QUEUE_LEN , max_send_udp_payload_size : MAX_SEND_UDP_PAYLOAD_SIZE , } ) }
Creates a config object with the given version.
Creates a config object with the given version .
version
u32
version
u32
examples:
```
let config = quiche::Config::new(quiche::PROTOCOL_VERSION)?.
` ` ` let config = quiche :: Config :: new ( quiche :: PROTOCOL_VERSION ) ? .
ok::<(), quiche::error>(())
None