add Client::headers

This commit is contained in:
fakeshadow 2021-03-25 23:20:38 +08:00
parent 3188ef5731
commit 88defccb3e
2 changed files with 11 additions and 0 deletions

View File

@ -1,6 +1,9 @@
# Changes # Changes
## Unreleased - 2021-xx-xx ## Unreleased - 2021-xx-xx
### Added
* Add `Client::headers` to get default mut reference of `HeaderMap` of client object.
### Changed ### Changed
* `ConnectorService` type is renamed to `BoxConnectorService` [#2081] * `ConnectorService` type is renamed to `BoxConnectorService` [#2081]

View File

@ -286,4 +286,12 @@ impl Client {
} }
req req
} }
/// Get default HeaderMap of Client.
///
/// Returns Some(&mut HeaderMap) when Client object is unique
/// (No other clone of client exists at the same time).
pub fn headers(&mut self) -> Option<&mut HeaderMap> {
Rc::get_mut(&mut self.0.headers)
}
} }