ApiServer
/// HTTP server allowing the registration of ApiEndpoint implementations.
pub struct ApiServer {
shutdown_sender: Option<oneshot::Sender<()>>,
}
低层用的是 futures.
To use it, just have your service(s) implement the ApiEndpoint trait and register them on a ApiServer.
API 以服务的形式运行,有客户端、服务端。
支持 TLS 链接。
/// TLS config
#[derive(Clone)]
pub struct TLSConfig {
pub certificate: String,
pub private_key: String,
}