Enum ErrorKind

Source
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§

Source§

impl Debug for ErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.