pub enum ErrorKind {
Show 17 variants TooBigPacket, InvalidPacketKind, UnknownPacketKind, SerializingFailed, DeserializingFailed, InvalidBufferSize, WritingToStreamFailed, ReadingFromStreamFailed, SendingToAddressFailed, ReceivingFromAddressFailed, CreatingDirFailed, CreatingFileFailed, OpeningFileFailed, WritingToFileFailed, ReadingFromFileFailed, ParsingFailed, OtherSource(Box<dyn Error>),
}
Expand description

Enum containing all error kinds used in nardol.

Variants

TooBigPacket

Used if Packet size is bigger than MAX_PACKET_SIZE.

InvalidPacketKind

Used if packet kind was not expected or a function or a method was used on wrong PacketKind variant.

UnknownPacketKind

Used if fails to recognize PacketKind.

SerializingFailed

Used if serializing struct with serde fails.

DeserializingFailed

Used if deserializing struct with serde fails.

InvalidBufferSize

Used if buffer size is not valid for the operation, usually used in implementations of TryFrom<Bytes>.

WritingToStreamFailed

Used if an error occurs during writing to TcpStream.

ReadingFromStreamFailed

Used if an error occurs during reading from TcpStream.

SendingToAddressFailed

Used if and error occurs during sending data to the address using an UdpSocket

ReceivingFromAddressFailed

Used if and error occurs during receiving data from the address using an UdpSocket

CreatingDirFailed

Used if an error occurs while trying to create a directory.

CreatingFileFailed

Used if an error occurs while trying to create a file.

OpeningFileFailed

Used if an error occurs while trying to open a file.

WritingToFileFailed

Used if an error occurs while trying to write to a file.

ReadingFromFileFailed

Used if an error occurs while trying to read from a file.

ParsingFailed

Used if anything fails to parse.

OtherSource(Box<dyn Error>)

Wrapper around every error not originating from this library, used if there is a need to use produced error directly.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.