1use std::{ffi, io, num};
16use thiserror::Error;
17
18#[derive(Error, Debug)]
19pub enum Error {
20 #[error("invalid configuration")]
21 InvalidConfig,
22
23 #[error("not implementated")]
24 NotImplemented,
25
26 #[error("device name too long")]
27 NameTooLong,
28
29 #[error("invalid device name")]
30 InvalidName,
31
32 #[error("invalid address")]
33 InvalidAddress,
34
35 #[error("invalid file descriptor")]
36 InvalidDescriptor,
37
38 #[error("unsuported network layer of operation")]
39 UnsupportedLayer,
40
41 #[error("invalid queues number")]
42 InvalidQueuesNumber,
43
44 #[error(transparent)]
45 Io(#[from] io::Error),
46
47 #[error(transparent)]
48 Nul(#[from] ffi::NulError),
49
50 #[error(transparent)]
51 ParseNum(#[from] num::ParseIntError),
52}
53
54pub type Result<T> = ::std::result::Result<T, Error>;