Skip to content

Commit 5baa165

Browse files
committed
Add some docs for RequestProxy
1 parent 882749b commit 5baa165

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/util/request_proxy.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! A helper that wraps a request and can overwrite either the path or the method.
2+
13
use std::{io::Read, net::SocketAddr};
24

35
use conduit::{Method, Request};
@@ -14,6 +16,7 @@ pub struct RequestProxy<'a> {
1416
}
1517

1618
impl<'a> RequestProxy<'a> {
19+
/// Wrap a request and overwrite the path with the provided value.
1720
pub(crate) fn rewrite_path(req: RequestMutRef<'a>, path: &'a str) -> Self {
1821
RequestProxy {
1922
other: req,
@@ -22,6 +25,7 @@ impl<'a> RequestProxy<'a> {
2225
}
2326
}
2427

28+
/// Wrap a request and overwrite the method with the provided value.
2529
pub(crate) fn rewrite_method(req: RequestMutRef<'a>, method: Method) -> Self {
2630
RequestProxy {
2731
other: req,

0 commit comments

Comments
 (0)