Lines Matching refs:Body
32 //! # Various Body Types
58 /// Synchronous `Body` trait definition.
65 /// The `sync_impl::Body` trait allows for reading body data synchronously.
69 /// [`TextBody`] implements `sync_impl::Body`:
72 /// use ylong_http::body::sync_impl::Body;
99 pub trait Body {
104 /// were read. Body data will be written into buf as much as possible.
126 /// [`TextBody`] implements `sync_impl::Body`:
129 /// use ylong_http::body::sync_impl::Body;
164 impl<T: Read> Body for T {
173 /// Asynchronous `Body` trait definition.
183 /// The `async_impl::Body` trait allows for reading body data
188 /// [`TextBody`] implements `async_impl::Body`:
191 /// use ylong_http::body::async_impl::Body;
220 pub trait Body: Unpin + Sized {
226 /// Body data will be written into buf as much as possible.
234 /// many bytes were read. Body data will be written into buf as much
258 /// [`TextBody`] implements `async_impl::Body`:
261 /// use ylong_http::body::async_impl::Body;
324 /// use ylong_http::body::async_impl::Body;
359 /// This future is the return value of `async_impl::Body::trailer`.
362 T: Body + 'a,
369 T: Body + 'a,
381 /// This future is the return value of `async_impl::Body::data`.
383 /// [`async_impl::Body::data`]: Body::data
386 T: Body + 'a + 'b,
394 T: Body + 'a + 'b,
522 pub struct FromAsyncBody<T: super::async_impl::Body> {
526 impl<T: super::async_impl::Body> FromAsyncBody<T> {
532 impl<T: super::async_impl::Body> Deref for FromAsyncBody<T> {
540 impl<T: super::async_impl::Body> DerefMut for FromAsyncBody<T> {
551 /// UT test cases for `sync_impl::Body::data` of `&mut sync_impl::Body`.
554 /// 1. Creates a `sync_impl::Body` object.
556 /// 3. Calls its `sync_impl::Body::data` method and then checks the results.
559 use crate::body::sync_impl::Body;
567 /// UT test cases for `async_impl::Body::data` of `&mut async_impl::Body`.
570 /// 1. Creates a `async_impl::Body` object.
572 /// 3. Calls its `async_impl::Body::data` method and then checks the
585 use crate::body::async_impl::Body;