#[non_exhaustive]pub enum InvalidEncodingReason {
Show 26 variants
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,
},
LengthOutOfRange {
max: usize,
actual: usize,
},
InvalidEnumValue {
value: i128,
},
EnumDiscriminantOutOfRange {
value: i128,
},
LpVec3ScaleOutOfRange {
scale_factor: u64,
max: u64,
},
InvalidRegistryId {
value: i32,
max: i32,
},
InvalidEntityMetadataIndex {
index: u8,
},
DuplicateEntityMetadataIndex {
index: u8,
},
InvalidOptionalVarInt {
value: i32,
},
InvalidIdOrSelector {
value: i32,
},
InvalidIdSetType {
value: i32,
},
InvalidSlotCount {
value: i64,
},
InvalidFixedBitSetLength {
expected: usize,
actual: usize,
},
OptionalValueMismatch {
context_present: bool,
value_present: bool,
},
MissingContext {
required: ContextRequirement,
},
ArrayLengthMismatch {
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.
Some reasons describe a mismatch between a codec and the context supplied by its enclosing packet.
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.
LengthOutOfRange
The length cannot be represented by the encoded length prefix.
Fields
InvalidEnumValue
A decoded numeric enum value does not name a declared variant.
EnumDiscriminantOutOfRange
An enum variant’s numeric discriminant cannot be represented on the wire.
LpVec3ScaleOutOfRange
An LpVec3 scale factor exceeds the 34-bit wire representation.
Fields
InvalidRegistryId
A registry ID cannot be represented by the ID or X wire format.
Fields
InvalidEntityMetadataIndex
An entity metadata entry uses the reserved 0xff terminator as its index.
DuplicateEntityMetadataIndex
An entity metadata sequence contains the same index more than once.
InvalidOptionalVarInt
An Optional VarInt selector cannot be mapped to a present value.
InvalidIdOrSelector
The decoded ID or X selector is negative.
InvalidIdSetType
The decoded ID Set type value is negative.
InvalidSlotCount
A non-empty item stack count must fit a positive VarInt.
InvalidFixedBitSetLength
The packed byte array does not have the required fixed length.
Fields
OptionalValueMismatch
An optional value does not agree with its externally supplied context.
Fields
MissingContext
A contextual codec was used without the information it requires.
Fields
required: ContextRequirementThe kind of information that was not supplied.
ArrayLengthMismatch
The number of array values does not match the contextual 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.