Enum DcsError Copy item path Source #[non_exhaustive]
pub enum DcsError {
UnknownPacketLength {
got: usize ,
},
VoiceMagicMissing {
got: [u8 ; 4 ],
},
StreamIdZero,
UnknownConnectTag {
tag: [u8 ; 3 ],
},
UnlinkModuleByteInvalid {
byte: u8 ,
},
InvalidModuleByte {
offset: usize ,
byte: u8 ,
},
EncodeBufferTooSmall {
need: usize ,
have: usize ,
},
NoTxHeader,
}Expand description Errors returned by the DCS codec functions.
This enum is marked as non-exhaustive Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
DCS packet length is not one of the known sizes.
Voice frame magic at [0..4] is not b"0001".
Stream id at [43..45] is zero.
Connect reply tag at [10..13] is neither ACK nor NAK.
UNLINK byte [9] is not the expected space (0x20).
LINK or UNLINK packet has a non-A-Z module byte at [8] or [9].
Fields Byte offset within the 19- or 519-byte packet.
An encoder was called with an undersized output buffer.
Programming error inside crate::session::client::SessionCore ;
surfaced as a variant rather than swallowed so callers can
still observe the fault.
Fields How many bytes the encoder needed.
How many bytes the buffer actually held.
send_voice / send_eot called before send_header cached the TX header.
The DCS wire format embeds the D-STAR header in every 100-byte
voice frame, so crate::session::client::SessionCore must
have a cached header before it can encode voice data or EOT.
Call send_header first.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Returns the lower-level source of this error, if any.
Read more 👎 Deprecated since 1.42.0: use the Display impl or to_string()
👎 Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬 This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Instruments this type with the provided [
Span], returning an
Instrumented wrapper.
Read more Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.