Skip to main content

oxilean_std/io/
ioerrorkind_traits.rs

1//! # IoErrorKind - Trait Implementations
2//!
3//! This module contains trait implementations for `IoErrorKind`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::types::IoErrorKind;
12use std::fmt;
13
14impl std::fmt::Display for IoErrorKind {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        let s = match self {
17            IoErrorKind::NotFound => "not found",
18            IoErrorKind::PermissionDenied => "permission denied",
19            IoErrorKind::ConnectionRefused => "connection refused",
20            IoErrorKind::TimedOut => "timed out",
21            IoErrorKind::UnexpectedEof => "unexpected end of file",
22            IoErrorKind::WriteZero => "write zero",
23            IoErrorKind::InvalidData => "invalid data",
24            IoErrorKind::Other => "other",
25        };
26        write!(f, "{}", s)
27    }
28}