pub struct Parse<T> { /* private fields */ }
Expand description
A parser that separates taking a response type from the readable body type.
Implementations§
Source§impl<T: IsOk + DeserializeOwned> Parse<T>
impl<T: IsOk + DeserializeOwned> Parse<T>
Sourcepub fn from_slice<B: AsRef<[u8]>, H: Into<HttpResponseHead>>(
self,
head: H,
body: B,
) -> Result<T, ResponseError>
pub fn from_slice<B: AsRef<[u8]>, H: Into<HttpResponseHead>>( self, head: H, body: B, ) -> Result<T, ResponseError>
Try parse a contiguous slice of bytes into a concrete response.
Sourcepub fn from_reader<B: Read, H: Into<HttpResponseHead>>(
self,
head: H,
body: B,
) -> Result<T, ResponseError>
pub fn from_reader<B: Read, H: Into<HttpResponseHead>>( self, head: H, body: B, ) -> Result<T, ResponseError>
Try parse an arbitrary reader into a concrete response.
Auto Trait Implementations§
impl<T> Freeze for Parse<T>
impl<T> RefUnwindSafe for Parse<T>where
T: RefUnwindSafe,
impl<T> Send for Parse<T>where
T: Send,
impl<T> Sync for Parse<T>where
T: Sync,
impl<T> Unpin for Parse<T>where
T: Unpin,
impl<T> UnwindSafe for Parse<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more