#[non_exhaustive]pub enum DPlusError {
UnknownPacketLength {
got: usize,
},
DsvtMagicMissing {
got: [u8; 4],
},
StreamIdZero,
InvalidShortControlByte {
byte: u8,
},
AuthChunkTruncated {
offset: usize,
need: usize,
have: usize,
},
AuthChunkFlagsInvalid {
offset: usize,
byte: u8,
},
AuthChunkTypeInvalid {
offset: usize,
byte: u8,
},
AuthChunkUndersized {
offset: usize,
claimed: usize,
},
CallsignFieldInvalid {
field: CallsignField,
},
EncodeBufferTooSmall {
need: usize,
have: usize,
},
}Expand description
Errors returned by the DPlus codec functions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnknownPacketLength
DPlus packet length is not one of the known sizes.
Valid non-DSVT lengths: 3 (poll), 5 (LINK1/UNLINK ACK), 8 (LINK2 reply), 28 (LINK2 / echo). Valid DSVT lengths: 29 (voice data), 32 (voice EOT), 58 (voice header).
DsvtMagicMissing
Packet expected to be DSVT-framed but the magic at [2..6] is wrong.
StreamIdZero
Stream id at offsets [14..16] is zero (reserved per D-STAR spec).
InvalidShortControlByte
The 5-byte non-DSVT packet has an unknown control byte at offset 4.
Valid values: 0x00 (UNLINK), 0x01 (LINK1).
AuthChunkTruncated
DPlus auth chunk truncated at offset {offset}: needed {need} bytes, have {have}.
Fields
AuthChunkFlagsInvalid
Auth chunk flag byte [1] failed validation — (b1 & 0xC0) != 0xC0.
AuthChunkTypeInvalid
Auth chunk type byte [2] is not 0x01.
AuthChunkUndersized
Auth chunk length {claimed} is smaller than the 8-byte chunk header.
CallsignFieldInvalid
Reserved for callsign parsing errors on received packets.
Currently unused — the lenient RX path uses
Callsign::from_wire_bytes which stores bytes verbatim and
cannot fail. This variant exists so that if a future strict
mode rejects non-printable wire callsigns at the codec
level, the error type already carries the right shape
without a breaking API change (the enum is #[non_exhaustive]).
Fields
field: CallsignFieldWhich callsign field.
EncodeBufferTooSmall
An encoder was called with an undersized output buffer.
This is a programming error inside
crate::session::client::SessionCore — it should never
fire in production because the core sizes its own scratch
buffers. Propagated as a variant rather than swallowed so
callers can still surface the fault.
Trait Implementations§
Source§impl Clone for DPlusError
impl Clone for DPlusError
Source§fn clone(&self) -> DPlusError
fn clone(&self) -> DPlusError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more