Skip to content

Commit cee36d4

Browse files
committed
feat(client): add Request.set_uri(RequestUri) method (#803)
1 parent ce3dbd1 commit cee36d4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/client/request.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ impl<'a> Request<'a> {
3838
/// Get a mutable reference to the Request headers.
3939
#[inline]
4040
pub fn headers_mut(&mut self) -> &mut Headers { &mut self.head.headers }
41+
42+
/// Set the `RequestUri` of this request.
43+
#[inline]
44+
pub fn set_uri(&mut self, uri: RequestUri) { self.head.subject.1 = uri; }
45+
46+
/// Set the `HttpVersion` of this request.
47+
#[inline]
48+
pub fn set_version(&mut self, version: HttpVersion) { self.head.version = version; }
4149
}
4250

4351
pub fn new(head: &mut RequestHead) -> Request {

0 commit comments

Comments
 (0)