pub enum PacketError {
TooLarge(usize, usize),
IO(Error),
AES(Error),
Broken(),
}
Expand description
Error when send/recv packets.
Variants§
TooLarge(usize, usize)
The packet size is larger than the maximum allowed packet size. This is due to you sending too much data at once, resulting in triggering memory safety limit.
You can reduce the size of data packet sent each time. Or you can change the maximum packet size by call [tcp_handler::config::set_config].
IO(Error)
During io bytes.
AES(Error)
Available on crate feature
encryption
only.During encrypting/decrypting bytes.
Broken()
Available on crate feature
encryption
only.Broken stream cipher. This is a fatal error.
When another error returned during send/recv, the stream is broken because no Cipher
received.
In order not to panic, marks this stream as broken and returns this error.
Trait Implementations§
Source§impl Debug for PacketError
impl Debug for PacketError
Source§impl Display for PacketError
impl Display for PacketError
Source§impl Error for PacketError
impl Error for PacketError
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()
Source§impl From<Error> for PacketError
impl From<Error> for PacketError
Auto Trait Implementations§
impl Freeze for PacketError
impl !RefUnwindSafe for PacketError
impl Send for PacketError
impl Sync for PacketError
impl Unpin for PacketError
impl !UnwindSafe for PacketError
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