#[non_exhaustive]pub enum SessionError {
Cancel,
Internal,
Unauthorized,
ProtocolViolation,
KeyValueFormatting,
GoawayTimeout,
Timeout,
Version,
App(u16),
Unknown(u32),
}Expand description
A code sent when terminating the session.
One of the two wire registries specified by moq-lite, which reuse moq-transport’s codes
unchanged; 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 registered code, so the registry round-trips: 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
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.
ProtocolViolation
The peer broke a protocol rule; the session is unusable.
KeyValueFormatting
A key-value pair was malformed or repeated more than allowed.
GoawayTimeout
The peer did not close within the GOAWAY drain deadline.
Timeout
A control message took too long.
Version
No version could be negotiated.
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 SessionError
impl SessionError
Sourcepub fn from_code(code: u32) -> Self
pub fn from_code(code: u32) -> Self
Decode a code received off the wire.
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.
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.