Skip to content

Commit 9c230ba

Browse files
committed
Add some docs
1 parent 755967d commit 9c230ba

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

tests/compression/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#![allow(unused_imports)]
22

3-
// TODO(david): document that using a multi threaded tokio runtime is
4-
// required (because of `block_in_place`)
5-
// TODO(david): send_gzip on channel, but disabling compression of a message
6-
73
use self::util::*;
84
use futures::{Stream, StreamExt};
95
use std::{

tonic-build/src/client.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,16 @@ pub fn generate<T: Service>(
5858
#service_ident::new(InterceptedService::new(inner, interceptor))
5959
}
6060

61-
// TODO(david): docs
61+
/// Compress requests with `gzip`.
62+
///
63+
/// This requires the server to support it otherwise it might respond with an
64+
/// error.
6265
pub fn send_gzip(mut self) -> Self {
6366
self.inner = self.inner.send_gzip();
6467
self
6568
}
6669

67-
// TODO(david): docs
70+
/// Enable decompressing responses with `gzip`.
6871
pub fn accept_gzip(mut self) -> Self {
6972
self.inner = self.inner.accept_gzip();
7073
self

tonic-build/src/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ pub fn generate<T: Service>(
4646

4747
let configure_compression_methods = if compression_enabled {
4848
quote! {
49-
// TODO(david): docs
49+
/// Enable decompressing requests with `gzip`.
5050
pub fn accept_gzip(mut self) -> Self {
5151
self.accept_compression_encodings.enable_gzip();
5252
self
5353
}
5454

55-
// TODO(david): docs
55+
/// Compress responses with `gzip`, if the client supports it.
5656
pub fn send_gzip(mut self) -> Self {
5757
self.send_compression_encodings.enable_gzip();
5858
self

0 commit comments

Comments
 (0)