glib-win32 0.22.6

Rust bindings for the GLibWin32 library
Documentation
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::ffi;
use glib::translate::*;

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GWin32OSType")]
pub enum OSType {
    #[doc(alias = "G_WIN32_OS_ANY")]
    Any,
    #[doc(alias = "G_WIN32_OS_WORKSTATION")]
    Workstation,
    #[doc(alias = "G_WIN32_OS_SERVER")]
    Server,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for OSType {
    type GlibType = ffi::GWin32OSType;

    #[inline]
    fn into_glib(self) -> ffi::GWin32OSType {
        match self {
            Self::Any => ffi::G_WIN32_OS_ANY,
            Self::Workstation => ffi::G_WIN32_OS_WORKSTATION,
            Self::Server => ffi::G_WIN32_OS_SERVER,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GWin32OSType> for OSType {
    #[inline]
    unsafe fn from_glib(value: ffi::GWin32OSType) -> Self {
        match value {
            ffi::G_WIN32_OS_ANY => Self::Any,
            ffi::G_WIN32_OS_WORKSTATION => Self::Workstation,
            ffi::G_WIN32_OS_SERVER => Self::Server,
            value => Self::__Unknown(value),
        }
    }
}