network_toolset 0.1.0

A comprehensive network diagnostic toolset implemented in Rust
Documentation
use thiserror::Error;

#[derive(Error, Debug)]
pub enum NetworkError {
    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),

    #[error("Socket operation failed: {0}")]
    SocketError(String),

    #[error("Network address parsing error: {0}")]
    AddressParseError(#[from] std::net::AddrParseError),

    #[error("DNS resolution error: {0}")]
    DnsError(String),

    #[error("Permission denied: Administrator privileges required")]
    PermissionDenied,

    #[error("Packet parsing error: {0}")]
    PacketParseError(String),

    #[error("Timeout error")]
    Timeout,

    #[error("Invalid packet format: {0}")]
    InvalidFormat(String),

    #[error("Platform not supported: {0}")]
    PlatformNotSupported(String),

    #[error("Invalid input: {0}")]
    InvalidInput(String),
}

pub type NetworkResult<T> = Result<T, NetworkError>;