diff --git a/src/response.rs b/src/response.rs index d0384eb..c33b792 100644 --- a/src/response.rs +++ b/src/response.rs @@ -21,6 +21,11 @@ impl Response { } } + #[inline] + pub fn is_ok(self: &Self) -> bool { + self.status.reply_type() == ReplyType::Success + } + pub fn ensure_ok(self: Self) -> Result { if self.status.reply_type() == ReplyType::Success { Ok(self)