Mercurial > crates > systemd-socket
comparison src/error.rs @ 21:f6334887e3c8
Support `tokio` 1.0
Tokio 1.0 was already out for a while and this adds the missing support
for it. Deprecation of 0.2 and 0.3 is planned but they are staying for
now.
| author | Martin Habovstiak <martin.habovstiak@gmail.com> |
|---|---|
| date | Sat, 13 Jul 2024 15:09:13 +0200 |
| parents | bc76507dd878 |
| children | 1941e9d9819c |
comparison
equal
deleted
inserted
replaced
| 20:2b78a483f84b | 21:f6334887e3c8 |
|---|---|
| 79 | 79 |
| 80 /// Error that can happen when binding Tokio socket. | 80 /// Error that can happen when binding Tokio socket. |
| 81 /// | 81 /// |
| 82 /// As opposed to `std` and `async_std` sockets, tokio sockets can fail to convert. | 82 /// As opposed to `std` and `async_std` sockets, tokio sockets can fail to convert. |
| 83 /// This error type expresses this possibility. | 83 /// This error type expresses this possibility. |
| 84 #[cfg(any(feature = "tokio_0_2", feature = "tokio_0_3"))] | 84 #[cfg(any(feature = "tokio", feature = "tokio_0_2", feature = "tokio_0_3"))] |
| 85 #[derive(Debug, Error)] | 85 #[derive(Debug, Error)] |
| 86 #[error(transparent)] | 86 #[error(transparent)] |
| 87 pub enum TokioBindError { | 87 pub enum TokioBindError { |
| 88 /// Either binding of socket or receiving systemd socket failed | 88 /// Either binding of socket or receiving systemd socket failed |
| 89 Bind(#[from] BindError), | 89 Bind(#[from] BindError), |
| 94 /// Error that can happen when converting Tokio socket. | 94 /// Error that can happen when converting Tokio socket. |
| 95 /// | 95 /// |
| 96 /// As opposed to `std` and `async_std` sockets, tokio sockets can fail to convert. | 96 /// As opposed to `std` and `async_std` sockets, tokio sockets can fail to convert. |
| 97 /// This error type encapsulates conversion error together with additional information so that it | 97 /// This error type encapsulates conversion error together with additional information so that it |
| 98 /// can be displayed nicely. The encapsulation also allows for future-proofing. | 98 /// can be displayed nicely. The encapsulation also allows for future-proofing. |
| 99 #[cfg(any(feature = "tokio_0_2", feature = "tokio_0_3"))] | 99 #[cfg(any(feature = "tokio", feature = "tokio_0_2", feature = "tokio_0_3"))] |
| 100 #[derive(Debug, Error)] | 100 #[derive(Debug, Error)] |
| 101 #[error("failed to convert std socket {addr} into tokio socket")] | 101 #[error("failed to convert std socket {addr} into tokio socket")] |
| 102 pub struct TokioConversionError { | 102 pub struct TokioConversionError { |
| 103 pub(crate) addr: crate::SocketAddrInner, | 103 pub(crate) addr: crate::SocketAddrInner, |
| 104 #[source] | 104 #[source] |
