udp/server/error/
impl.rs

1use super::r#enum::ServerError;
2use crate::*;
3
4/// Standard error implementation for ServerError.
5impl StdError for ServerError {}
6
7/// Display implementation for ServerError.
8impl Display for ServerError {
9    /// Formats the error for display.
10    ///
11    /// # Arguments
12    ///
13    /// - `&fmt::Formatter` - Formatter for the output.
14    ///
15    /// # Returns
16    ///
17    /// - `fmt::Result` - Result of formatting operation.
18    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19        match self {
20            Self::TcpBindError(data) => write!(f, "Tcp bind error{COLON_SPACE}{data}"),
21            Self::Unknown => write!(f, "Unknown"),
22        }
23    }
24}