[go: up one dir, main page]

gio 0.9.1

Rust bindings for the Gio 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 gio_sys;
#[cfg(any(feature = "v2_54", feature = "dox"))]
use glib::translate::*;
#[cfg(any(feature = "v2_54", feature = "dox"))]
use glib::GString;
use gobject_sys;
#[cfg(any(feature = "v2_54", feature = "dox"))]
use std;
use std::cmp;
#[cfg(any(feature = "v2_54", feature = "dox"))]
use Icon;

glib_wrapper! {
    #[derive(Debug)]
    pub struct UnixMountPoint(Boxed<gio_sys::GUnixMountPoint>);

    match fn {
        copy => |ptr| gobject_sys::g_boxed_copy(gio_sys::g_unix_mount_point_get_type(), ptr as *mut _) as *mut gio_sys::GUnixMountPoint,
        free => |ptr| gobject_sys::g_boxed_free(gio_sys::g_unix_mount_point_get_type(), ptr as *mut _),
        get_type => || gio_sys::g_unix_mount_point_get_type(),
    }
}

impl UnixMountPoint {
    #[cfg(any(feature = "v2_54", feature = "dox"))]
    fn compare(&self, mount2: &UnixMountPoint) -> i32 {
        unsafe {
            gio_sys::g_unix_mount_point_compare(
                mut_override(self.to_glib_none().0),
                mut_override(mount2.to_glib_none().0),
            )
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn get_device_path(&self) -> Option<std::path::PathBuf> {
        unsafe {
            from_glib_none(gio_sys::g_unix_mount_point_get_device_path(mut_override(
                self.to_glib_none().0,
            )))
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn get_fs_type(&self) -> Option<GString> {
        unsafe {
            from_glib_none(gio_sys::g_unix_mount_point_get_fs_type(mut_override(
                self.to_glib_none().0,
            )))
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn get_mount_path(&self) -> Option<std::path::PathBuf> {
        unsafe {
            from_glib_none(gio_sys::g_unix_mount_point_get_mount_path(mut_override(
                self.to_glib_none().0,
            )))
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn get_options(&self) -> Option<GString> {
        unsafe {
            from_glib_none(gio_sys::g_unix_mount_point_get_options(mut_override(
                self.to_glib_none().0,
            )))
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn guess_can_eject(&self) -> bool {
        unsafe {
            from_glib(gio_sys::g_unix_mount_point_guess_can_eject(mut_override(
                self.to_glib_none().0,
            )))
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn guess_icon(&self) -> Option<Icon> {
        unsafe {
            from_glib_full(gio_sys::g_unix_mount_point_guess_icon(mut_override(
                self.to_glib_none().0,
            )))
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn guess_name(&self) -> Option<GString> {
        unsafe {
            from_glib_full(gio_sys::g_unix_mount_point_guess_name(mut_override(
                self.to_glib_none().0,
            )))
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn guess_symbolic_icon(&self) -> Option<Icon> {
        unsafe {
            from_glib_full(gio_sys::g_unix_mount_point_guess_symbolic_icon(
                mut_override(self.to_glib_none().0),
            ))
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn is_loopback(&self) -> bool {
        unsafe {
            from_glib(gio_sys::g_unix_mount_point_is_loopback(mut_override(
                self.to_glib_none().0,
            )))
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn is_readonly(&self) -> bool {
        unsafe {
            from_glib(gio_sys::g_unix_mount_point_is_readonly(mut_override(
                self.to_glib_none().0,
            )))
        }
    }

    #[cfg(any(feature = "v2_54", feature = "dox"))]
    pub fn is_user_mountable(&self) -> bool {
        unsafe {
            from_glib(gio_sys::g_unix_mount_point_is_user_mountable(mut_override(
                self.to_glib_none().0,
            )))
        }
    }
}

impl PartialEq for UnixMountPoint {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.compare(other) == 0
    }
}

impl Eq for UnixMountPoint {}

impl PartialOrd for UnixMountPoint {
    #[inline]
    fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
        self.compare(other).partial_cmp(&0)
    }
}

impl Ord for UnixMountPoint {
    #[inline]
    fn cmp(&self, other: &Self) -> cmp::Ordering {
        self.compare(other).cmp(&0)
    }
}