#[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,
},
InvalidFixedBitSetLength {
expected: usize,
actual: usize,
},
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
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.
InvalidFixedBitSetLength
The packed byte array does not have the required fixed length.
Fields
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
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 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.