#[non_exhaustive]pub enum ProtocolError {
Show 13 variants
IncompletePacket {
expected: usize,
actual: usize,
},
InvalidPacketType(u8),
InvalidTokenType(u8),
InvalidDataType(u8),
InvalidPreloginOption(u8),
InvalidTdsVersion(u32),
StringEncoding(String),
PacketTooLarge {
length: usize,
max: usize,
},
InvalidPacketStatus(u8),
BufferOverflow {
needed: usize,
capacity: usize,
},
UnexpectedEof,
UnsupportedVersion(u32),
InvalidField {
field: &'static str,
value: u32,
},
}Expand description
Errors that can occur during TDS protocol parsing or encoding.
Variants (Non-exhaustive)§
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.
IncompletePacket
Packet data is truncated or incomplete.
InvalidPacketType(u8)
Invalid packet type value.
InvalidTokenType(u8)
Invalid token type value.
InvalidDataType(u8)
Invalid data type value.
InvalidPreloginOption(u8)
Invalid prelogin option.
InvalidTdsVersion(u32)
Invalid TDS version.
StringEncoding(String)
String encoding error.
PacketTooLarge
Packet length exceeds maximum allowed.
InvalidPacketStatus(u8)
Invalid packet status flags.
BufferOverflow
Buffer overflow during encoding.
UnexpectedEof
Unexpected end of stream.
UnsupportedVersion(u32)
Protocol version mismatch.
InvalidField
Invalid field value in a protocol structure.
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnwindSafe for ProtocolError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more