feat(codec): Configure max request message size (#1274)
* feat(codec): add max_message_size parameter resolves #1097 * refactor(client): add max size parameters * refactor(tonic-build): update server gen template * refactor(tonic-build): update client template * fix(tonic-build): update client template * fix(tonic-build): small typo in server.rs * fix(tonic-build): client.rs generator * fix(tonic): add apply max message setting size to server * fix(test): wrong message size * fix: doctest + generated rs
This commit is contained in:
@@ -137,6 +137,20 @@ pub(crate) fn generate_internal<T: Service>(
|
||||
self
|
||||
}
|
||||
|
||||
/// Limits the maximum size of a decoded message.
|
||||
#[must_use]
|
||||
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
|
||||
self.inner = self.inner.max_decoding_message_size(limit);
|
||||
self
|
||||
}
|
||||
|
||||
/// Limits the maximum size of an encoded message.
|
||||
#[must_use]
|
||||
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
|
||||
self.inner = self.inner.max_encoding_message_size(limit);
|
||||
self
|
||||
}
|
||||
|
||||
#methods
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user