committed by
					
						 Sean McArthur
						Sean McArthur
					
				
			
			
				
	
			
			
			
						parent
						
							7bd3619ece
						
					
				
				
					commit
					c417d6dab8
				
			| @@ -2,6 +2,7 @@ use std::fmt; | ||||
|  | ||||
| use futures::{Stream, Poll, Async}; | ||||
| use bytes::Bytes; | ||||
| use hyper::body::Payload; | ||||
|  | ||||
| /// An asynchronous `Stream`. | ||||
| pub struct Body { | ||||
| @@ -20,6 +21,13 @@ impl Body { | ||||
|             Inner::Reusable(_) => unreachable!(), | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     pub(crate) fn content_length(&self) -> Option<u64> { | ||||
|         match self.inner { | ||||
|             Inner::Reusable(ref bytes) => Some(bytes.len() as u64), | ||||
|             Inner::Hyper(ref body) => body.content_length(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl Stream for Body { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user