librqbit_dualstack_sockets/
error.rs1#[derive(thiserror::Error, Debug)]
2pub enum Error {
3 #[error("error taking ownership of a socket from a file descriptor: {0}")]
4 SocketFromFd(std::io::Error),
5 #[error("error creating socket: {0}")]
6 SocketNew(std::io::Error),
7 #[error("error binding: {0}")]
8 Bind(std::io::Error),
9 #[error("error setting only_v6={value}: {source}")]
10 OnlyV6 { value: bool, source: std::io::Error },
11 #[error("error setting SO_REUSEADDR: {0}")]
12 ReuseAddress(std::io::Error),
13 #[error("error getting local_addr(): {0}")]
14 LocalAddr(std::io::Error),
15 #[error("as_socket() returned None")]
16 AsSocket,
17 #[error("error setting nonblocking=true: {0}")]
18 SetNonblocking(std::io::Error),
19 #[error("mismatch between local_addr and requested bind_addr")]
20 LocalBindAddrMismatch,
21 #[error("error listening")]
22 Listen(std::io::Error),
23 #[error("error calling tokio from_std")]
24 TokioFromStd(std::io::Error),
25 #[error("did not join any multicast groups")]
26 MulticastJoinFail,
27 #[error("provided link-local address is not link-local")]
28 ProvidedLinkLocalAddrIsntLinkLocal,
29 #[error("no network interfaces found")]
30 NoNics,
31 #[error("provided site-local address is not site-local")]
32 ProvidedSiteLocalAddrIsNotSiteLocal,
33 #[error("error setting SO_REUSEPORT")]
34 ReusePort(std::io::Error),
35 #[error("error waiting for socket to become writeable")]
36 Writeable(std::io::Error),
37 #[error("error calling set_multicast_if_v6")]
38 SetMulticastIpv6(std::io::Error),
39 #[error("error calling set_multicast_if_v4")]
40 SetMulticastIpv4(std::io::Error),
41 #[error("send_multicast_msg called with conflicting parameters")]
42 SendMulticastMsgProtocolMismatch,
43 #[error("error sending: {0:#}")]
44 Send(std::io::Error),
45 #[error("binding to device is not supported on your OS")]
46 BindDeviceNotSupported,
47 #[error("invalid bind device")]
48 BindDeviceInvalid,
49 #[error("invalid bind device: {0:#}")]
50 BindDeviceInvalidError(std::io::Error),
51 #[error("error setting bind device: {0:#}")]
52 BindDeviceSetDeviceError(std::io::Error),
53 #[error("error connecting: {0:#}")]
54 Connect(std::io::Error),
55}
56
57pub type Result<T> = core::result::Result<T, Error>;