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 f61708b commit 0de2956Copy full SHA for 0de2956
src/http/mod.rs
@@ -71,10 +71,26 @@ impl<S> MessageHead<S> {
71
}
72
73
74
+impl ResponseHead {
75
+ /// Converts this head's RawStatus into a StatusCode.
76
+ #[inline]
77
+ pub fn status(&self) -> StatusCode {
78
+ self.subject.status()
79
+ }
80
+}
81
+
82
/// The raw status code and reason-phrase.
83
#[derive(Clone, PartialEq, Debug)]
84
pub struct RawStatus(pub u16, pub Cow<'static, str>);
85
86
+impl RawStatus {
87
+ /// Converts this into a StatusCode.
88
89
90
+ StatusCode::from_u16(self.0)
91
92
93
94
impl fmt::Display for RawStatus {
95
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
96
write!(f, "{} {}", self.0, self.1)
0 commit comments