Skip to content

Commit 49744b1

Browse files
author
victor
committed
transport: unify request modifiers and reduce allocations
1 parent 61bb3da commit 49744b1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tonic/src/transport/channel/service/request_modifiers.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ use std::task::{Context, Poll};
33
use tower_service::Service;
44
use crate::body::Body;
55

6+
/// A generic request modifier.
7+
///
8+
/// `Modifier<M, T>` wraps an inner service `T` and applies the
9+
/// modifier `M` to each outgoing `Request`.
10+
///
11+
/// This type centralizes the boilerplate for implementing
12+
/// request middleware. A modifier is closure which receives
13+
/// the request and mutates it before forwarding to the
14+
/// inner service.
615
#[derive(Debug)]
716
pub(crate) struct Modifier<M, T> {
817
modifier_fn: M,

0 commit comments

Comments
 (0)