pub fn from_quic(connecting: quinn::Connecting, settings: Settings) -> Self {
        Self {
            connecting,
            settings,
        }
    }
/// Construct a HTTP/3 handshake `Future` from an ongoing QUIC handshake
///
/// Makes supporting several protocols over one endpoint possible, by accepting
/// incoming connections initialization at the QUIC level. The client's ALPN protocol can
/// then be used to route this new connection to the requested protocol. Say if
/// the ALPN matches [`quinn_h3::ALPN`], you can safely use [`Connecting::from_quic()`],
/// to handle this connection.
///
/// Note that [`From<quinn::Connecting>`] is also available if default settings suit
/// your needs.
///
/// # Example: support multiple protocols over quic
/// ```no_run
/// # use quinn;
/// # async fn serve_h3(conn: quinn_h3::server::Connecting) { unimplemented!() }
/// # async fn serve_tea(conn: quinn::Connecting) { unimplemented!() }
/// # fn main() {
/// # use quinn_h3::{server, Settings};
/// # tokio::runtime::Runtime::new().unwrap().block_on(async {
/// use std::net::ToSocketAddrs;
/// use futures::StreamExt;
///
/// use quinn;
/// use quinn_h3::server;
///
/// let mut server_config = quinn::ServerConfigBuilder::default();
/// // server_config.certificate(cert_chain, key)
/// server_config.protocols(&[quinn_h3::ALPN, b"teapotmq"]);
///
/// let mut quic_builder = quinn::Endpoint::builder();
/// quic_builder.listen(server_config.build());
///
/// let (_, mut incoming) =
///     quic_builder.bind(&"[::]:443".parse().unwrap()).unwrap();
///
/// while let Some(mut connecting) = incoming.next().await {
///     let data = match connecting.handshake_data().await {
///         Err(_) => continue,
///         Ok(x) => x,
///     };
///     match &data.protocol.unwrap()[..] {
///         b"teapotmq" => serve_tea(connecting).await,
///         quinn_h3::ALPN => {
///             let connecting =
///                 quinn_h3::server::Connecting::from_quic(connecting, Settings::default());
///             serve_h3(connecting).await;
///         }
///         _ => (),
///     }
/// }
/// # });
/// # }
/// ```
///
/// [`quinn_h3::ALPN`]: ../constant.ALPN.html
/// [`Connecting::from_quic()`]: #method.from_quic
/// [`From<quinn::Connecting>`]: #method.from
Construct a HTTP/3 handshake `Future` from an ongoing QUIC handshake
Makes supporting several protocols over one endpoint possible, by accepting
incoming connections initialization at the QUIC level. The client's ALPN protocol can
then be used to route this new connection to the requested protocol. Say if
the ALPN matches [`quinn_h3::ALPN`], you can safely use [`Connecting::from_quic()`],
to handle this connection.

Note that [`From`] is also available if default settings suit
your needs.
Construct a HTTP / 3 handshake ` Future ` from an ongoing QUIC handshake Makes supporting several protocols over one endpoint possible by accepting incoming connections initialization at the QUIC level . The client ' s ALPN protocol can then be used to route this new connection to the requested protocol . Say if the ALPN matches [ ` quinn_h3 :: ALPN ` ] you can safely use [ ` Connecting :: from_quic () ` ] to handle this connection . Note that [ ` From ` ] is also available if default settings suit your needs .
pub fn from_quic(connecting: quinn::Connecting, settings: Settings) -> Self {
        Self {
            connecting,
            settings,
        }
    }
pub fn from_quic ( connecting : quinn :: Connecting , settings : Settings ) -> Self { Self { connecting , settings , } }
Construct a HTTP/3 handshake `Future` from an ongoing QUIC handshake
Makes supporting several protocols over one endpoint possible, by accepting
incoming connections initialization at the QUIC level.
Construct a HTTP / 3 handshake ` Future ` from an ongoing QUIC handshake Makes supporting several protocols over one endpoint possible by accepting incoming connections initialization at the QUIC level .
connecting
quinn::Connecting
settings
Settings
example: support multiple protocols over quic
None
use quinn;
None
async fn serve_h3(conn: quinn_h3::server::connecting) { unimplemented!() }
None
async fn serve_tea(conn: quinn::connecting) { unimplemented!() }
None
fn main() {
None
use quinn_h3::{server, settings};
None
tokio::runtime::runtime::new().unwrap().block_on(async {
use std::net::ToSocketAddrs;
use futures::StreamExt.

use quinn;
use quinn_h3::server.

let mut server_config = quinn::ServerConfigBuilder::default();
server_config.certificate(cert_chain, key)
server_config.protocols(&[quinn_h3::ALPN, b"teapotmq"]).

let mut quic_builder = quinn::Endpoint::builder();
quic_builder.listen(server_config.build()).



while let Some(mut connecting) = incoming.next().await {
let data = match connecting.handshake_data().await {
Err(_) => continue,
Ok(x) => x,
};
match &data.protocol.unwrap()[..] {
b"teapotmq" => serve_tea(connecting).await,
quinn_h3::ALPN => {
let connecting
quinn_h3::server::Connecting::from_quic(connecting, Settings::default());
serve_h3(connecting).await;
}
_ => (),
}
}
use std :: net :: ToSocketAddrs ; use futures :: StreamExt . use quinn ; use quinn_h3 :: server . let mut server_config = quinn :: ServerConfigBuilder :: default () ; server_config . certificate ( cert_chain key ) server_config . protocols ( & [ quinn_h3 :: ALPN b " teapotmq " ] ) . let mut quic_builder = quinn :: Endpoint :: builder () ; quic_builder . listen ( server_config . build () ) . while let Some ( mut connecting ) = incoming . next () . await { let data = match connecting . handshake_data () . await { Err ( _ ) = > continue Ok ( x ) = > x } ; match &data . protocol . unwrap () [ .. ] { b " teapotmq " = > serve_tea ( connecting ) . await quinn_h3 :: ALPN = > { let connecting quinn_h3 :: server :: Connecting :: from_quic ( connecting Settings :: default () ) ; serve_h3 ( connecting ) . await ; } _ = > () } }
});
None
}


[`quinn_h3::ALPN`]: ../constant.ALPN.html
[`Connecting::from_quic()`]: #method.from_quic
[`From`]: #method.from
[ ` quinn_h3 :: ALPN ` ] : .. / constant . ALPN . html [ ` Connecting :: from_quic () ` ] : #method . from_quic [ ` From ` ] : #method . from