#[non_exhaustive]pub enum SessionError {
}Expand description
A code sent when terminating the session.
moq-lite’s session registry, which reuses moq-transport’s value for each code the two
share; 64+ are the application’s. The stream registry is StreamError and the two
are disjoint, so the same integer means different things in each.
Every variant is a code moq-lite assigns, and round-trips through
to_code and from_code. A code moq-lite does not
assign, including those only moq-transport defines, is Unknown with
its number. Codes 32 through 47 are reserved and have no assigned meaning.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Cancel
Ending the session normally, with no error.
Internal
Something went wrong that isn’t worth a dedicated code.
The peer’s token does not grant the requested path or operation. Retrying with the same credentials will fail again.
Expired
The peer’s token has expired. Retrying with refreshed credentials may succeed.
ProtocolViolation
The peer broke a protocol rule; the session is unusable.
TooManyRequests
The peer went past what the session allows, such as more announcements than its
crate::session::Limits.
GoawayTimeout
The peer did not close within the GOAWAY drain deadline.
Timeout
A control message took too long.
Version
No version could be negotiated.
MalformedAuthToken
The peer’s token could not be parsed. Retrying with the same token will fail again.
App(u16)
An application-chosen code, offset into the 64+ range on the wire.
Unknown(u32)
A code moq-lite does not assign, kept verbatim: one this version does not recognize, or one only moq-transport defines.
Unsupported
The peer cannot support the requested feature, token, or grant.
Implementations§
Source§impl SessionError
impl SessionError
Sourcepub fn from_code(code: u32) -> Self
pub fn from_code(code: u32) -> Self
Decode a code from moq-lite’s registry.
Unlike a raw peer code, the registered ones are specified, so decoding them is a
wire contract rather than an assumption. Anything unregistered stays
Self::Unknown, including the reserved 32-47 and the codes only moq-transport
defines.
Trait Implementations§
Source§impl Clone for SessionError
impl Clone for SessionError
Source§impl Debug for SessionError
impl Debug for SessionError
Source§impl Display for SessionError
impl Display for SessionError
impl Eq for SessionError
Source§impl Error for SessionError
impl Error for SessionError
1.30.0 · 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 SessionError
Which session code to send for a local error.
impl From<&Error> for SessionError
Which session code to send for a local error.
Lossy on purpose: Error describes what went wrong locally, while the registry is what
the peer can act on. Anything stream-scoped reaching a session close is a bug on our side,
so it degrades to SessionError::Internal rather than inventing a code.
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<SessionError> for Error
Preserve the session registry when carrying a protocol error.
impl From<SessionError> for Error
Preserve the session registry when carrying a protocol error.
Source§fn from(err: SessionError) -> Self
fn from(err: SessionError) -> Self
Source§impl PartialEq for SessionError
impl PartialEq for SessionError
impl StructuralPartialEq for SessionError
Auto Trait Implementations§
impl Freeze for SessionError
impl RefUnwindSafe for SessionError
impl Send for SessionError
impl Sync for SessionError
impl Unpin for SessionError
impl UnsafeUnpin for SessionError
impl UnwindSafe for SessionError
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.