#[non_exhaustive]pub enum CodecError {
Io(Error),
Protocol(ProtocolError),
PacketTooLarge {
size: usize,
max: usize,
},
MessageTooLarge {
size: usize,
limit: usize,
},
IncompletePacket {
needed: usize,
},
InvalidHeader,
ConnectionClosed,
Cancelled,
Encoding(String),
Decoding(String),
}Expand description
Errors that can occur during packet encoding/decoding.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
IO error during read/write operations.
Protocol(ProtocolError)
Protocol-level error from tds-protocol.
PacketTooLarge
Packet too large.
MessageTooLarge
Assembled response message exceeded the configured size limit.
IncompletePacket
Incomplete packet data.
InvalidHeader
Invalid packet header.
ConnectionClosed
Connection closed unexpectedly.
Cancelled
The in-flight request was cancelled via an Attention signal and the server acknowledged the cancellation (DONE_ATTN). The connection is drained and remains usable for new requests.
Encoding(String)
Encoding error.
Decoding(String)
Decoding error.
Implementations§
Source§impl CodecError
impl CodecError
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Check if this error is transient and may succeed on retry.
IO errors and connection closures are typically transient. Protocol, encoding, and header errors are terminal.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Check if this error is terminal and will never succeed on retry.
Trait Implementations§
Source§impl Debug for CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
Source§impl Error for CodecError
impl Error for CodecError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()