For example, let's say I want to parse a configuration file to build my tonic server:
// Let's exclude the file parsing code since it's not the focus here
struct MyTonicConfig {
http1: bool,
concurrency_limit: Option<usize>,
keep_alive: Option<std::time::Duration>,
}
fn build_tonic_by_config(config: MyTonicConfig) -> tonic::transport::Server {
let mut my_tonic_server = Server::builder();
if config.http1 {
my_tonic_server = my_tonic_server.accept_http1(true);
}
if let Some(concurrency_limit) = config.concurrency_limit {
my_tonic_server = my_tonic_server.concurrency_limit_per_connection(concurrency_limit);
}
my_tonic_server = my_tonic_server.http2_keepalive_timeout(config.keep_alive);
my_tonic_server
}
I would like to be able to inspect the resulting tonic server to be sure my code is working as expected, but I can't find any getter for tonic::transportation::Server fields.
Similar, but I think more complicated, scenario I think is applicable for Router and Routes.
Proposal
The simplest solution I can think is to add getters for tonic::transportaion:Server
Alternatives
Implement an "expect" like method that can compare tonic::transportaion:Server fields value with given test value.
Implement PartialEq/Eq for tonic::transportaion:Server
Feature Request
Motivation
For example, let's say I want to parse a configuration file to build my tonic server:
I would like to be able to inspect the resulting tonic server to be sure my code is working as expected, but I can't find any getter for
tonic::transportation::Server
fields.Similar, but I think more complicated, scenario I think is applicable for Router and Routes.
Proposal
The simplest solution I can think is to add getters for
tonic::transportaion:Server
Alternatives
tonic::transportaion:Server
fields value with given test value.PartialEq
/Eq
fortonic::transportaion:Server