#[non_exhaustive]pub enum StreamError {
Show 21 variants
Session(SessionError),
Internal,
Cancel,
DeliveryTimeout,
NotSupported,
ControlTimeout,
GoingAway,
TooFarBehind,
MalformedTrack,
NotFound,
Unroutable,
Old,
Evicted,
WrongSize,
FrameTooLarge,
GroupTooLarge,
TimestampMismatch,
Skip,
Unauthorized,
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.
NotSupported
The request asks what the publisher can’t serve on this track.
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, or a track asked for again was accepted with info other than what its readers already hold.
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, or the frames a reader still needed from its front, 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 could not make room for a write, even by shedding its front, and was aborted.
TimestampMismatch
A frame’s timestamp doesn’t fit its track: missing on a timed track, present on an untimed one, out of range for the track’s timescale, or starting a group earlier than the group before it.
Skip
The publisher declared that no group will ever exist at these starts.
Sent in SUBSCRIBE_DROP on lite-07: final, cacheable emptiness that ends no reader.
The grant does not cover this subscription, fetch, or announcement, or no longer
does. Unlike SessionError::Unauthorized, the session stays up.
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.
Source§fn from(err: StreamError) -> Self
fn from(err: StreamError) -> Self
Source§impl PartialEq for StreamError
impl PartialEq for StreamError
impl StructuralPartialEq for StreamError
Auto Trait Implementations§
impl Freeze for StreamError
impl RefUnwindSafe for StreamError
impl Send for StreamError
impl Sync for StreamError
impl Unpin for StreamError
impl UnsafeUnpin for StreamError
impl UnwindSafe 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
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
key and return true if they are equal.