pub enum ValidationError {
Show 20 variants
ToneCodeOutOfRange(u8),
BandOutOfRange(u8),
ModeOutOfRange(u8),
MemoryModeOutOfRange(u8),
PowerLevelOutOfRange(u8),
ToneModeOutOfRange(u8),
ShiftOutOfRange(u8),
StepSizeOutOfRange(u8),
FineStepOutOfRange(u8),
DataSpeedOutOfRange(u8),
LockoutOutOfRange(u8),
DcsCodeInvalid(u8),
ChannelNameTooLong {
len: usize,
},
FrequencyOutOfRange(u32),
DigitalSquelchCodeOutOfRange(u8),
CrossToneTypeOutOfRange(u8),
FlashDigitalSquelchOutOfRange(u8),
ChannelOutOfRange {
channel: u16,
max: u16,
},
SettingOutOfRange {
name: &'static str,
value: u8,
detail: &'static str,
},
AprsWireOutOfRange {
field: &'static str,
detail: &'static str,
},
}Expand description
Errors raised when a user-supplied value fails validation.
Variants§
ToneCodeOutOfRange(u8)
The CTCSS tone code is outside the valid range 0-49.
BandOutOfRange(u8)
The band index is outside the valid range 0-13.
ModeOutOfRange(u8)
The operating mode is outside the valid range 0-7.
MemoryModeOutOfRange(u8)
The memory (flash) mode is outside the valid range 0-7.
PowerLevelOutOfRange(u8)
The power level is outside the valid range 0-3.
ToneModeOutOfRange(u8)
The tone mode is outside the valid range 0-2.
ShiftOutOfRange(u8)
The shift direction is outside the valid 4-bit range 0-15.
StepSizeOutOfRange(u8)
The step size index is outside the valid range 0-11.
FineStepOutOfRange(u8)
The fine step index is outside the valid range 0-3.
DataSpeedOutOfRange(u8)
The data speed is outside the valid range 0-1.
LockoutOutOfRange(u8)
The lockout mode is outside the valid range 0-2.
DcsCodeInvalid(u8)
The DCS code index is not in the valid code table.
ChannelNameTooLong
The channel name exceeds the maximum length of 8 characters.
FrequencyOutOfRange(u32)
The frequency is outside the valid range for the band.
DigitalSquelchCodeOutOfRange(u8)
The digital squelch code is outside the valid range 0-99.
CrossToneTypeOutOfRange(u8)
The cross-tone type is outside the valid range 0-3.
FlashDigitalSquelchOutOfRange(u8)
The flash digital squelch mode is outside the valid range 0-2.
ChannelOutOfRange
The channel number is outside the valid range.
SettingOutOfRange
A settings/configuration enum value is outside its valid range.
Used for MCP binary settings types (backlight, EQ, language, etc.) where adding a dedicated variant per type would be excessive.
Fields
AprsWireOutOfRange
A runtime APRS wire-format value failed validation.
Used by the aprs and ax25-codec crates for typed primitives
such as Callsign, Latitude, Longitude, Course, and
MessageId where the failing value may be too wide to fit in a
u8.