qinterface 0.4.0

gm-quic's packet routing and definition of the underlying IO interface
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::io;

use qbase::net::addr::BindUri;

use crate::{factory::ProductQuicIO, iface::handy::*};

#[cfg(all(feature = "qudp", any(unix, windows)))]
pub static DEFAULT_QUIC_IO_FACTORY: fn(BindUri) -> io::Result<qudp::UdpSocketController> =
    qudp::UdpSocketController::bind;

#[cfg(not(all(feature = "qudp", any(unix, windows))))]
pub static DEFAULT_QUIC_IO_FACTORY: fn(BindUri) -> io::Result<unsupported::Unsupported> =
    unsupported::Unsupported::bind;

fn _assert_impl_quic_io_factory() {
    fn assert_impl<F: ProductQuicIO + Copy>(_: F) {}
    assert_impl(DEFAULT_QUIC_IO_FACTORY);
}