proxmox-rest-server: add comment why ApiService needs to be 'pub'

This commit is contained in:
Dietmar Maurer 2021-10-01 08:35:51 +02:00
parent 038f385089
commit 593043ed53
1 changed files with 8 additions and 4 deletions

View File

@ -139,10 +139,14 @@ impl Service<&tokio::net::UnixStream> for RestServer {
} }
} }
/// Helper [Service] containing the peer Address // Helper [Service] containing the peer Address
/// //
/// The lower level connection [Service] implementation on // The lower level connection [Service] implementation on
/// [RestServer] extracts the peer address and return an [ApiService]. // [RestServer] extracts the peer address and return an [ApiService].
//
// Rust wants this type 'pub' here (else we get 'private type `ApiService`
// in public interface'). The type is still private because the crate does
// not export it.
pub struct ApiService { pub struct ApiService {
pub peer: std::net::SocketAddr, pub peer: std::net::SocketAddr,
pub api_config: Arc<ApiConfig>, pub api_config: Arc<ApiConfig>,