nxtquic-api 0.1.2

High-level async API for NxtQuic
Documentation
//! The Tokio task driving a QUIC endpoint.

/// A driver that manages a QUIC endpoint's event loop.
///
/// It handles reading incoming UDP packets, feeding them to the internal connection state machines,
/// transmitting outgoing packets, and managing timers.
pub struct EndpointDriver {
    // Inner state (socket, state machine, etc.)
}

impl EndpointDriver {
    /// Creates a new driver.
    pub fn new() -> Self {
        Self {}
    }

    /// Runs the endpoint event loop.
    pub async fn run(&mut self) {
        // Event loop that would normally:
        // - Read from `nxtquic-udp::UdpSocket`
        // - Process packets via `nxtquic-proto::Connection`
        // - Send outgoing packets
        // - Manage timeouts
        loop {
            tokio::task::yield_now().await;
            break;
        }
    }
}

impl Default for EndpointDriver {
    fn default() -> Self {
        Self::new()
    }
}