File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1571,6 +1571,31 @@ impl StatusCode {
15711571 StatusClass :: ServerError
15721572 }
15731573 }
1574+
1575+ /// Check if class is Informational.
1576+ pub fn is_informational ( & self ) -> bool {
1577+ self . class ( ) == StatusClass :: Informational
1578+ }
1579+
1580+ /// Check if class is Success.
1581+ pub fn is_success ( & self ) -> bool {
1582+ self . class ( ) == StatusClass :: Success
1583+ }
1584+
1585+ /// Check if class is Redirection.
1586+ pub fn is_redirection ( & self ) -> bool {
1587+ self . class ( ) == StatusClass :: Redirection
1588+ }
1589+
1590+ /// Check if class is ClientError.
1591+ pub fn is_client_error ( & self ) -> bool {
1592+ self . class ( ) == StatusClass :: ClientError
1593+ }
1594+
1595+ /// Check if class is ServerError.
1596+ pub fn is_server_error ( & self ) -> bool {
1597+ self . class ( ) == StatusClass :: ServerError
1598+ }
15741599}
15751600
15761601impl Copy for StatusCode { }
You can’t perform that action at this time.
0 commit comments