#[non_exhaustive]pub struct StreamProtocolError {
pub reason: StreamProtocolErrorReason,
pub last_seq: Option<i64>,
pub frame_id: Option<i64>,
pub event: Option<String>,
pub bytes: usize,
pub media_type: Option<String>,
}Expand description
The stream broke the SSE contract. The connection is closed.
The raw payload is deliberately not carried: it may hold data you would not
want in a log, and frame_id plus last_seq name the frame exactly.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.reason: StreamProtocolErrorReasonWhat was wrong.
last_seq: Option<i64>The last sequence delivered on this connection. No malformed frame moves it.
frame_id: Option<i64>The SSE id of the offending frame, when it carried one.
event: Option<String>The offending frame’s SSE event name.
bytes: usizeThe offending frame’s size in bytes.
media_type: Option<String>The response’s Content-Type, for StreamProtocolErrorReason::UnexpectedMediaType.
Trait Implementations§
Source§impl Clone for StreamProtocolError
impl Clone for StreamProtocolError
Source§impl Debug for StreamProtocolError
impl Debug for StreamProtocolError
Source§impl Display for StreamProtocolError
impl Display for StreamProtocolError
impl Eq for StreamProtocolError
Source§impl Error for StreamProtocolError
impl Error for StreamProtocolError
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<StreamProtocolError> for Error
impl From<StreamProtocolError> for Error
Source§fn from(source: StreamProtocolError) -> Self
fn from(source: StreamProtocolError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for StreamProtocolError
impl PartialEq for StreamProtocolError
impl StructuralPartialEq for StreamProtocolError
Auto Trait Implementations§
impl Freeze for StreamProtocolError
impl RefUnwindSafe for StreamProtocolError
impl Send for StreamProtocolError
impl Sync for StreamProtocolError
impl Unpin for StreamProtocolError
impl UnsafeUnpin for StreamProtocolError
impl UnwindSafe for StreamProtocolError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.