gio/auto/
unix_fd_list.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 crate::ffi;
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    #[doc(alias = "GUnixFDList")]
10    pub struct UnixFDList(Object<ffi::GUnixFDList, ffi::GUnixFDListClass>);
11
12    match fn {
13        type_ => || ffi::g_unix_fd_list_get_type(),
14    }
15}
16
17impl UnixFDList {
18    pub const NONE: Option<&'static UnixFDList> = None;
19
20    #[doc(alias = "g_unix_fd_list_new")]
21    pub fn new() -> UnixFDList {
22        unsafe { from_glib_full(ffi::g_unix_fd_list_new()) }
23    }
24}
25
26impl Default for UnixFDList {
27    fn default() -> Self {
28        Self::new()
29    }
30}
31
32pub trait UnixFDListExt: IsA<UnixFDList> + 'static {
33    #[doc(alias = "g_unix_fd_list_get_length")]
34    #[doc(alias = "get_length")]
35    fn length(&self) -> i32 {
36        unsafe { ffi::g_unix_fd_list_get_length(self.as_ref().to_glib_none().0) }
37    }
38}
39
40impl<O: IsA<UnixFDList>> UnixFDListExt for O {}