gio/auto/
simple_permission.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use gio_sys;
6use glib::object::Cast;
7use glib::translate::*;
8use std::fmt;
9use Permission;
10
11glib_wrapper! {
12    pub struct SimplePermission(Object<gio_sys::GSimplePermission, SimplePermissionClass>) @extends Permission;
13
14    match fn {
15        get_type => || gio_sys::g_simple_permission_get_type(),
16    }
17}
18
19impl SimplePermission {
20    pub fn new(allowed: bool) -> SimplePermission {
21        unsafe {
22            Permission::from_glib_full(gio_sys::g_simple_permission_new(allowed.to_glib()))
23                .unsafe_cast()
24        }
25    }
26}
27
28impl fmt::Display for SimplePermission {
29    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
30        write!(f, "SimplePermission")
31    }
32}