We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c557349 commit 53073aeCopy full SHA for 53073ae
my-http-server-core/src/http_headers/header_value.rs
@@ -10,8 +10,8 @@ use crate::{
10
};
11
12
pub struct HeaderValue<'s> {
13
- name: &'static str,
14
- value: &'s [u8],
+ pub name: &'static str,
+ pub value: &'s [u8],
15
}
16
17
impl<'s> HeaderValue<'s> {
@@ -97,6 +97,14 @@ impl TryInto<u8> for HeaderValue<'_> {
97
98
99
100
+impl TryInto<bool> for HeaderValue<'_> {
101
+ type Error = HttpFailResult;
102
+ fn try_into(self) -> Result<bool, Self::Error> {
103
+ let value = self.as_str()?;
104
+ crate::convert_from_str::to_bool(self.name, value, SRC_HEADER)
105
+ }
106
+}
107
+
108
impl TryInto<i8> for HeaderValue<'_> {
109
type Error = HttpFailResult;
110
fn try_into(self) -> Result<i8, Self::Error> {
0 commit comments