#[non_exhaustive]pub enum StreamError {
Show 18 variants
Session(SessionError),
Internal,
Cancel,
DeliveryTimeout,
ControlTimeout,
GoingAway,
TooFarBehind,
MalformedTrack,
NotFound,
Unroutable,
Old,
Evicted,
WrongSize,
FrameTooLarge,
GroupTooLarge,
TimestampMismatch,
App(u16),
Unknown(u32),
}Expand description
A code sent when resetting a stream, or refusing to receive one.
The counterpart to SessionError, and a disjoint space: a stream reset of 0 is
Internal, not a cancellation (Cancel is 1).
Conditions the shared codes don’t cover are assigned in moq-lite’s own 48-63 range and
round-trip like any other registered code. 32 through 47 is reserved: nothing is sent
there and a received one stays Unknown.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Session(SessionError)
The session ended, taking this stream with it.
The specific SessionError is local only: the two registries are disjoint, so
this encodes to a single SESSION_CLOSED and the peer learns the reason from the
session close itself.
Internal
Something went wrong that isn’t worth a dedicated code.
Cancel
The sender is done with this stream, not failing. A routine unsubscribe.
DeliveryTimeout
The content missed its delivery deadline.
ControlTimeout
A control request took too long to be answered. The stream counterpart to
SessionError::Timeout, which covers the same condition at session scope.
GoingAway
The session is going away (a GOAWAY was received).
TooFarBehind
The reader fell too far behind and content was dropped to catch up.
MalformedTrack
The track’s content could not be parsed.
NotFound
The requested broadcast or track does not exist at the peer.
Unroutable
The broadcast is neither announced nor served, so there is no route to it.
Old
The group was superseded by a newer group and dropped.
Evicted
The group was dropped under memory pressure. Unlike Old it was still
current, so it can be re-fetched.
WrongSize
A frame’s payload length disagreed with its declared size.
FrameTooLarge
A frame declared a payload larger than the receiver accepts.
GroupTooLarge
A group grew past its cache budget and was aborted.
TimestampMismatch
A frame’s timestamp doesn’t match its track’s negotiated timescale.
App(u16)
An application-chosen code, offset into the 64+ range on the wire.
Unknown(u32)
A code this version does not recognize, kept verbatim.
Implementations§
Source§impl StreamError
impl StreamError
Sourcepub fn from_code(code: u32) -> Self
pub fn from_code(code: u32) -> Self
Decode a code received off the wire.
Only the registered codes decode; anything else, the reserved 32-47 range included,
stays Unknown rather than being given a meaning the draft does
not assign.
SESSION_CLOSED decodes to Session(SessionError::Internal): the peer’s actual
session code is not on this stream, so the specific reason is unknown here.
Trait Implementations§
Source§impl Clone for StreamError
impl Clone for StreamError
Source§impl Debug for StreamError
impl Debug for StreamError
Source§impl Display for StreamError
impl Display for StreamError
impl Eq for StreamError
Source§impl Error for StreamError
impl Error for StreamError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<&Error> for StreamError
Which stream code to send for a local error.
impl From<&Error> for StreamError
Which stream code to send for a local error.
Session-scoped conditions route through StreamError::Session, which flattens to
SESSION_CLOSED on the wire.
Source§impl From<SessionError> for StreamError
impl From<SessionError> for StreamError
Source§fn from(source: SessionError) -> Self
fn from(source: SessionError) -> Self
Source§impl From<StreamError> for Error
Preserve the stream registry when carrying a protocol error.
impl From<StreamError> for Error
Preserve the stream registry when carrying a protocol error.