gaato/discord/endpoint_http does not have a README file

    ListenError

    Listener configuration, bind and accept failures.

    ServerConfigError

    Configuration errors reported by the bounded HTTP server.

    InteractionsServer

    pub struct InteractionsServer {
    // private fields
    }

    An HTTP server dispatching Discord interactions on native or moonrun Wasm.

    InteractionsServer::addr

    fn InteractionsServer::addr(self : InteractionsServer) -> String

    Return the actual listening address, including an OS-assigned port.

    InteractionsServer::close

    async fn InteractionsServer::close(self : InteractionsServer) -> Unit noraise

    Stop accepting requests and cancel active connection handlers.

    serve_interactions

    async fn serve_interactions(group :
    TaskGroup
    , app :
    App
    , addr~ : String, public_key~ : String, access~ :
    RestAccess
    , application_id? :
    Id
    [
    ApplicationMarker
    ], path? : String, deadline_ms? : Int, max_body_bytes? : Int, body_timeout_ms? : Int, header_timeout_ms? : Int, max_connections? : Int) -> InteractionsServer

    Start a Discord HTTP-interactions server in group on native or moonrun Wasm.

    Use port zero in addr to let the OS choose a free port, then read the resolved address from InteractionsServer::addr.

    A request body larger than max_body_bytes gets 413, and one not received within body_timeout_ms gets 408; both close the connection. Discord's interaction payloads are far below the 1 MiB default. A connection whose next request head does not arrive within header_timeout_ms, idle keep-alive time included, is closed (408 if a partial head arrived). Request heads and trailers are each limited to 16 KiB. A declared body over the limit is rejected before signature authentication. At most max_connections clients are served at once; more wait to be accepted. Non-positive limits raise ListenError::Config(ServerConfigError) before the server listens.