#[repr(u32)]pub enum DecodeErrorCode {
Show 36 variants
BufferTooShort = 1_000,
InvalidMagic = 1_001,
UnsupportedMajorVersion = 1_002,
UnsupportedMinorVersion = 1_003,
InvalidHeaderLength = 1_004,
InvalidFeatureFlags = 1_005,
InvalidReservedField = 1_006,
SectionTableOutOfBounds = 1_007,
DuplicateSection = 1_008,
MissingRequiredSection = 1_009,
UnknownSection = 1_010,
UnknownRequiredSection = 1_011,
InvalidSectionFlags = 1_012,
InvalidSectionAlignment = 1_013,
InvalidSectionBounds = 1_014,
InvalidRecordSize = 1_015,
InvalidSectionCount = 1_016,
OverlappingSection = 1_017,
InvalidPadding = 1_018,
TrailingPadding = 1_019,
InvalidStringOffset = 1_020,
InvalidUtf8 = 1_021,
InvalidStringRef = 1_022,
InvalidSourceRef = 1_023,
InvalidRootRef = 1_024,
InvalidNodeRef = 1_025,
InvalidTokenRef = 1_026,
InvalidTriviaRef = 1_027,
UnknownSyntaxKind = 1_028,
InvalidDiagnosticSeverity = 1_029,
UnknownDiagnosticCode = 1_030,
InvalidDiagnosticRange = 1_031,
InvalidSourceTextRange = 1_032,
InvalidExtendedData = 1_033,
InvalidEdgeKind = 1_034,
InvalidSpan = 1_035,
}Expand description
Programmatic decode failure code (1000..1999).
Code values are stable across the v0.1 surface so tests, fixture
validators, and language bindings can match on them without
parsing human-readable messages. The #[repr(u32)] with explicit
discriminants is the enforcement mechanism: reordering or
inserting a variant in the wrong place would change a stable
numeric value, and the snapshot_compat.rs guard test catches
it. When adding a new variant, append it at the end with the next
unused number and update the guard test in the same commit.
Variants§
BufferTooShort = 1_000
InvalidMagic = 1_001
UnsupportedMajorVersion = 1_002
UnsupportedMinorVersion = 1_003
InvalidHeaderLength = 1_004
InvalidFeatureFlags = 1_005
InvalidReservedField = 1_006
SectionTableOutOfBounds = 1_007
DuplicateSection = 1_008
MissingRequiredSection = 1_009
UnknownSection = 1_010
UnknownRequiredSection = 1_011
InvalidSectionFlags = 1_012
InvalidSectionAlignment = 1_013
InvalidSectionBounds = 1_014
InvalidRecordSize = 1_015
InvalidSectionCount = 1_016
OverlappingSection = 1_017
InvalidPadding = 1_018
TrailingPadding = 1_019
InvalidStringOffset = 1_020
InvalidUtf8 = 1_021
InvalidStringRef = 1_022
InvalidSourceRef = 1_023
InvalidRootRef = 1_024
InvalidNodeRef = 1_025
InvalidTokenRef = 1_026
InvalidTriviaRef = 1_027
UnknownSyntaxKind = 1_028
InvalidDiagnosticSeverity = 1_029
UnknownDiagnosticCode = 1_030
InvalidDiagnosticRange = 1_031
InvalidSourceTextRange = 1_032
InvalidExtendedData = 1_033
InvalidEdgeKind = 1_034
InvalidSpan = 1_035
Implementations§
Source§impl DecodeErrorCode
impl DecodeErrorCode
Sourcepub const fn as_u32(self) -> u32
pub const fn as_u32(self) -> u32
Stable numeric value used by tests, fixture validators,
and language bindings. The mapping is locked by the
compatibility guard in tests/snapshot_compat.rs.
Sourcepub const fn as_ox_mf2_error_code(self) -> OxMf2ErrorCode
pub const fn as_ox_mf2_error_code(self) -> OxMf2ErrorCode
Binding-oriented alias for Self::as_u32.
Sourcepub const fn as_u16(self) -> u16
pub const fn as_u16(self) -> u16
Legacy helper retained for callers that still use u16 widths.
Values fit in u16 for the v0.1 decode domain.
pub const fn name(self) -> &'static str
Trait Implementations§
Source§impl Clone for DecodeErrorCode
impl Clone for DecodeErrorCode
Source§fn clone(&self) -> DecodeErrorCode
fn clone(&self) -> DecodeErrorCode
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 DecodeErrorCode
Source§impl Debug for DecodeErrorCode
impl Debug for DecodeErrorCode
Source§impl Display for DecodeErrorCode
impl Display for DecodeErrorCode
impl Eq for DecodeErrorCode
Source§impl Hash for DecodeErrorCode
impl Hash for DecodeErrorCode
Source§impl PartialEq for DecodeErrorCode
impl PartialEq for DecodeErrorCode
Source§fn eq(&self, other: &DecodeErrorCode) -> bool
fn eq(&self, other: &DecodeErrorCode) -> bool
self and other values to be equal, and is used by ==.