winer 0.1.5

Inspect Wine runtimes, host OS details, and hosted processes
Documentation
use core::fmt;

use super::DllLoadOrder;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ArchError;

impl fmt::Display for ArchError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "invalid arch")
    }
}

impl std::error::Error for ArchError {}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum LogError {
    InvalidClass,
    InvalidOperation,
    InvalidChannel,
}

impl fmt::Display for LogError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::InvalidClass => write!(f, "invalid log class"),
            Self::InvalidOperation => write!(f, "invalid log operation"),
            Self::InvalidChannel => write!(f, "invalid log channel"),
        }
    }
}

impl std::error::Error for LogError {}

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DllOverrideError {
    InvalidLoadOrder { state: DllLoadOrder, char: char },
    InvalldOverride,
}

impl fmt::Display for DllOverrideError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::InvalidLoadOrder { state, char } => {
                write!(f, "invalid load order (state: {:?}, char: {})", state, char)
            }
            Self::InvalldOverride => write!(f, "invalid dll override"),
        }
    }
}

impl std::error::Error for DllOverrideError {}