pub struct StreamBodyError { /* private fields */ }Expand description
The error that may occur while encoding or decoding a streamed HTTP body.
Implementations§
Source§impl StreamError
impl StreamError
Sourcepub fn new(
kind: StreamErrorKind,
source: Option<Box<dyn Error + Sync + Send>>,
message: Option<String>,
) -> StreamError
pub fn new( kind: StreamErrorKind, source: Option<Box<dyn Error + Sync + Send>>, message: Option<String>, ) -> StreamError
Create a new instance of an error.
Public so that formats implemented outside this crate can report failures the same way the built-in ones do.
Sourcepub fn kind(&self) -> StreamErrorKind
pub fn kind(&self) -> StreamErrorKind
The kind of error that occurred.
Sourcepub fn into_parts(
self,
) -> (StreamErrorKind, Option<Box<dyn Error + Sync + Send>>, Option<String>)
pub fn into_parts( self, ) -> (StreamErrorKind, Option<Box<dyn Error + Sync + Send>>, Option<String>)
Takes the error apart, giving up ownership of its cause.
Exists so a binding crate can wrap its own error type to pass it through this crate’s
pipeline and then recover the original on the way out, by downcasting the returned
source. Without that, a round trip would leave the caller’s error nested inside a
StreamError inside their own error type, changing what their callbacks see.
Trait Implementations§
Source§impl Debug for StreamError
impl Debug for StreamError
Source§impl Display for StreamError
impl Display for StreamError
Source§impl Error for StreamError
impl Error for StreamError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for StreamError
impl From<Error> for StreamError
Source§fn from(err: Error) -> StreamError
fn from(err: Error) -> StreamError
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for StreamError
impl !UnwindSafe for StreamError
impl Freeze for StreamError
impl Send for StreamError
impl Sync for StreamError
impl Unpin for StreamError
impl UnsafeUnpin for StreamError
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