pub(crate) fn from_quinn_connection(
        endpoint: Arc<Endpoint>,
        connection: quinn_proto::Connection,
        connection_id: quinn_proto::ConnectionHandle,
        from_endpoint: mpsc::Receiver<quinn_proto::ConnectionEvent>,
    ) -> Self {
        // As the documentation mention, one is not supposed to call any of the methods on the
        // `quinn_proto::Connection` before entering this function, and consequently, even if the
        // connection has already been closed, there is no way for it to know that it has been
        // closed.
        assert!(!connection.is_closed());

        let is_handshaking = connection.is_handshaking();

        Connection {
            endpoint,
            pending_to_endpoint: None,
            connection,
            next_timeout: None,
            from_endpoint,
            connection_id,
            is_handshaking,
            closed: None,
        }
    }
/// Crate-internal function that builds a [`Connection`] from raw components.
///
/// This function assumes that there exists a background task that will process the messages
/// sent to `to_endpoint` and send us messages on `from_endpoint`.
///
/// The `from_endpoint` can be purposefully closed by the endpoint if the connection is too
/// slow to process.
// TODO: is this necessary ^? figure out if quinn_proto doesn't forbid that situation in the first place
///
/// `connection_id` is used to identify the local connection in the messages sent to
/// `to_endpoint`.
///
/// This function assumes that the [`quinn_proto::Connection`] is completely fresh and none of
/// its methods has ever been called. Failure to comply might lead to logic errors and panics.
// TODO: maybe abstract `to_endpoint` more and make it generic? dunno
Crate-internal function that builds a [`Connection`] from raw components.
This function assumes that there exists a background task that will process the messages
sent to `to_endpoint` and send us messages on `from_endpoint`.

The `from_endpoint` can be purposefully closed by the endpoint if the connection is too
slow to process.
TODO: is this necessary ^. figure out if quinn_proto doesn't forbid that situation in the first place

`connection_id` is used to identify the local connection in the messages sent to
`to_endpoint`.

This function assumes that the [`quinn_proto::Connection`] is completely fresh and none of
its methods has ever been called. Failure to comply might lead to logic errors and panics.
TODO: maybe abstract `to_endpoint` more and make it generic. dunno
Crate - internal function that builds a [ ` Connection ` ] from raw components . This function assumes that there exists a background task that will process the messages sent to ` to_endpoint ` and send us messages on ` from_endpoint ` . The ` from_endpoint ` can be purposefully closed by the endpoint if the connection is too slow to process . TODO : is this necessary ^ . figure out if quinn_proto doesn ' t forbid that situation in the first place ` connection_id ` is used to identify the local connection in the messages sent to ` to_endpoint ` . This function assumes that the [ ` quinn_proto :: Connection ` ] is completely fresh and none of its methods has ever been called . Failure to comply might lead to logic errors and panics . TODO : maybe abstract ` to_endpoint ` more and make it generic . dunno
pub(crate) fn from_quinn_connection(
        endpoint: Arc<Endpoint>,
        connection: quinn_proto::Connection,
        connection_id: quinn_proto::ConnectionHandle,
        from_endpoint: mpsc::Receiver<quinn_proto::ConnectionEvent>,
    ) -> Self {
        // As the documentation mention, one is not supposed to call any of the methods on the
        // `quinn_proto::Connection` before entering this function, and consequently, even if the
        // connection has already been closed, there is no way for it to know that it has been
        // closed.
        assert!(!connection.is_closed());
        let is_handshaking = connection.is_handshaking();
        Connection {
            endpoint,
            pending_to_endpoint: None,
            connection,
            next_timeout: None,
            from_endpoint,
            connection_id,
            is_handshaking,
            closed: None,
        }
    }
pub ( crate ) fn from_quinn_connection ( endpoint : Arc < Endpoint > , connection : quinn_proto :: Connection , connection_id : quinn_proto :: ConnectionHandle , from_endpoint : mpsc :: Receiver < quinn_proto :: ConnectionEvent > , ) -> Self { // As the documentation mention, one is not supposed to call any of the methods on the // `quinn_proto::Connection` before entering this function, and consequently, even if the // connection has already been closed, there is no way for it to know that it has been // closed. assert ! ( connection is_closed ( ) ) ; let is_handshaking = connection . is_handshaking ( ) ; Connection { endpoint , pending_to_endpoint : None , connection , next_timeout : None , from_endpoint , connection_id , is_handshaking , closed : None , } }
Crate-internal function that builds a [`Connection`] from raw components.
Crate - internal function that builds a [ ` Connection ` ] from raw components .
endpoint
Arc<Endpoint>
connection
quinn_proto::Connection
connection_id
quinn_proto::ConnectionHandle
from_endpoint
mpsc::Receiver<quinn_proto::ConnectionEvent>
endpoint
Arc<Endpoint>
connection
quinn_proto::Connection
connection_id
quinn_proto::ConnectionHandle
from_endpoint
mpsc::Receiver<quinn_proto::ConnectionEvent>