#[non_exhaustive]pub enum IoErrorKind {
TimedOut,
Interrupted,
PermissionDenied,
ConnectionRefused,
NetworkUnreachable,
WouldBlock,
Truncated,
Other,
}Expand description
Portable I/O error kinds surfaced by transport implementations.
This is a deliberately small vocabulary — anything that does not fit
maps to IoErrorKind::Other. The enum is #[non_exhaustive] so new
kinds can be added without a breaking change. Kept local to this crate
(rather than re-exporting embedded_io::ErrorKind) so our public API
does not move when embedded_io bumps major versions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TimedOut
The operation timed out.
Interrupted
The operation was interrupted and can be retried.
PermissionDenied
The caller lacks permission for the operation.
ConnectionRefused
A remote peer actively refused the connection / destination was unreachable.
NetworkUnreachable
The network layer rejected the operation (routing, MTU, etc.).
WouldBlock
A non-blocking call would have blocked. Transient — caller should retry or wait for readiness rather than treating as fatal.
Truncated
An inbound datagram was truncated because it exceeded the receive buffer. The datagram is discarded; the socket loop survives.
Backends that receive this signal MUST drop the datagram and continue
polling — it does NOT count toward the consecutive-error kill cap.
This variant is distinct from Self::Other so that genuine I/O
errors are still counted as potentially-fatal.
Other
Any error that does not fit a more specific variant.
Implementations§
Source§impl IoErrorKind
impl IoErrorKind
Sourcepub fn is_transient_recv(self) -> bool
pub fn is_transient_recv(self) -> bool
Returns true if a recv-loop error of this kind is a transient
condition that should not count toward a “kill the loop after N
consecutive errors” cap. Includes:
Self::ConnectionRefused— a peer’s ICMP port-unreachable reply is normal noise on a SOME/IP host that probes services that are not yet available;Self::NetworkUnreachable— a routing blip during interface migration is recoverable;Self::WouldBlock— by definition, retry-on-readiness;Self::Interrupted— a signal interrupted the syscall;Self::TimedOut— caller-driven timeout, not a socket failure;Self::Truncated— an inbound datagram was truncated because it exceeded the receive buffer; the datagram is dropped and the loop continues (distinct fromSelf::Otherso genuine I/O errors are still counted as potentially-fatal).
All other kinds (including Self::Other) are treated as
potentially-fatal and DO count toward the cap.
Trait Implementations§
Source§impl Clone for IoErrorKind
impl Clone for IoErrorKind
Source§fn clone(&self) -> IoErrorKind
fn clone(&self) -> IoErrorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for IoErrorKind
Source§impl Debug for IoErrorKind
impl Debug for IoErrorKind
Source§impl Display for IoErrorKind
impl Display for IoErrorKind
impl Eq for IoErrorKind
Source§impl Error for IoErrorKind
impl Error for IoErrorKind
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()