File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,11 @@ impl<State> Request<State> {
313313 pub fn len ( & self ) -> Option < usize > {
314314 self . request . len ( )
315315 }
316+ /// Checks if the body is empty.
317+ #[ must_use]
318+ pub fn is_empty ( & self ) -> Option < bool > {
319+ Some ( self . request . len ( ) ? == 0 )
320+ }
316321}
317322
318323impl < State > AsMut < http:: Request > for Request < State > {
Original file line number Diff line number Diff line change @@ -91,6 +91,12 @@ impl Response {
9191 self . res . len ( )
9292 }
9393
94+ /// Checks if the body is empty.
95+ #[ must_use]
96+ pub fn is_empty ( & self ) -> Option < bool > {
97+ Some ( self . res . len ( ) ? == 0 )
98+ }
99+
94100 /// Get an HTTP header.
95101 #[ must_use]
96102 pub fn header ( & self , name : & HeaderName ) -> Option < & Vec < HeaderValue > > {
You can’t perform that action at this time.
0 commit comments