#[non_exhaustive]pub enum ErrorResponse {
UnexpectedMessage,
MalformedMessage,
UnsupportedVersionRange,
InvalidCredentials,
UnknownNfcUid,
NfcUidThrottled,
AudioUnavailable,
Custom(u8),
}Expand description
An error reported by the server.
Error codes below 0x80 are reserved for the standard protocol; the
range above is available to extensions via ErrorResponse::Custom.
Decoding is total over the code byte: codes this crate does not know,
including reserved ones a future minor protocol version may define,
decode as Custom so an older client degrades gracefully instead of
treating the message as malformed. As a consequence, constructing
Custom with a code that has a dedicated variant (e.g. Custom(3)) does
not round-trip: it decodes as that variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnexpectedMessage
Unexpected message sent by the peer (fatal).
MalformedMessage
Sent message does not follow the protocol spec (fatal).
UnsupportedVersionRange
Requested version range is not supported (fatal).
InvalidCredentials
Invalid credentials sent in authentication (fatal).
UnknownNfcUid
The NFC UID is unknown.
NfcUidThrottled
The NFC UID is recognized but throttled.
No audio file is available for the given achievement.
Custom(u8)
An error code without a dedicated variant.
Implementations§
Source§impl ErrorResponse
impl ErrorResponse
Sourcepub fn from_code(code: u8) -> ErrorResponse
pub fn from_code(code: u8) -> ErrorResponse
Maps a wire code onto its error, falling back to Self::Custom.
Trait Implementations§
Source§impl Clone for ErrorResponse
impl Clone for ErrorResponse
Source§fn clone(&self) -> ErrorResponse
fn clone(&self) -> ErrorResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ErrorResponse
Source§impl Debug for ErrorResponse
impl Debug for ErrorResponse
Source§impl Decode for ErrorResponse
impl Decode for ErrorResponse
Source§fn decode(input: &mut &[u8]) -> Result<ErrorResponse, DecodeError>
fn decode(input: &mut &[u8]) -> Result<ErrorResponse, DecodeError>
input, advancing it past the
consumed bytes. Read moreSource§impl Encode for ErrorResponse
impl Encode for ErrorResponse
impl Eq for ErrorResponse
Source§impl<Ext> From<ErrorResponse> for ServerMessage<Ext>
impl<Ext> From<ErrorResponse> for ServerMessage<Ext>
Source§fn from(message: ErrorResponse) -> ServerMessage<Ext>
fn from(message: ErrorResponse) -> ServerMessage<Ext>
Source§impl Hash for ErrorResponse
impl Hash for ErrorResponse
Source§impl PartialEq for ErrorResponse
impl PartialEq for ErrorResponse
Source§impl Payload for ErrorResponse
impl Payload for ErrorResponse
impl StructuralPartialEq for ErrorResponse
Auto Trait Implementations§
impl Freeze for ErrorResponse
impl RefUnwindSafe for ErrorResponse
impl Send for ErrorResponse
impl Sync for ErrorResponse
impl Unpin for ErrorResponse
impl UnsafeUnpin for ErrorResponse
impl UnwindSafe for ErrorResponse
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more