#[non_exhaustive]pub enum InvalidEncodingReason {
TooLong {
max_bytes: usize,
},
ValueOutOfRange {
terminal_byte: u8,
allowed_mask: u8,
},
InvalidBooleanValue {
value: u8,
},
StringTooLong {
max_bytes: usize,
},
TooManyUtf16CodeUnits {
max_code_units: usize,
},
NegativeLength {
value: i32,
},
InvalidUtf8 {
valid_up_to: usize,
error_len: Option<usize>,
},
InvalidIdentifier,
InvalidNbt,
InvalidJson,
InvalidTextComponentRootTag {
tag: u8,
},
}Expand description
Describes why encoded protocol data is invalid.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
TooLong
The encoding exceeds the maximum allowed length in bytes.
ValueOutOfRange
The terminal byte of the encoding contains bits outside the allowed mask.
Fields
InvalidBooleanValue
The boolean value is invalid (not 0x00 or 0x01).
StringTooLong
The string exceeds the maximum allowed length in bytes when encoded in UTF-8.
Fields
TooManyUtf16CodeUnits
The string exceeds the maximum allowed length in UTF-16 code units.
NegativeLength
The length of the data is negative, which is invalid.
InvalidUtf8
The data contains an invalid UTF-8 sequence.
Fields
InvalidIdentifier
The data is not a valid Minecraft identifier.
InvalidNbt
The data is not valid NBT (Named Binary Tag) data.
InvalidJson
The data is not valid JSON.
InvalidTextComponentRootTag
The root tag of a text component is invalid (not TAG_String or TAG_Compound).
Trait Implementations§
Source§impl Clone for InvalidEncodingReason
impl Clone for InvalidEncodingReason
Source§fn clone(&self) -> InvalidEncodingReason
fn clone(&self) -> InvalidEncodingReason
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for InvalidEncodingReason
Source§impl Debug for InvalidEncodingReason
impl Debug for InvalidEncodingReason
Source§impl Display for InvalidEncodingReason
Formats an invalid encoding reason as a diagnostic message.
impl Display for InvalidEncodingReason
Formats an invalid encoding reason as a diagnostic message.
impl Eq for InvalidEncodingReason
Source§impl Hash for InvalidEncodingReason
impl Hash for InvalidEncodingReason
Source§impl PartialEq for InvalidEncodingReason
impl PartialEq for InvalidEncodingReason
impl StructuralPartialEq for InvalidEncodingReason
Auto Trait Implementations§
impl Freeze for InvalidEncodingReason
impl RefUnwindSafe for InvalidEncodingReason
impl Send for InvalidEncodingReason
impl Sync for InvalidEncodingReason
impl Unpin for InvalidEncodingReason
impl UnsafeUnpin for InvalidEncodingReason
impl UnwindSafe for InvalidEncodingReason
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
Mutably borrows from an owned value. Read more