gio/auto/
unix_input_stream.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::IsA;
7use glib::translate::*;
8use std::fmt;
9use InputStream;
10use PollableInputStream;
11
12glib_wrapper! {
13    pub struct UnixInputStream(Object<gio_sys::GUnixInputStream, gio_sys::GUnixInputStreamClass, UnixInputStreamClass>) @extends InputStream, @implements PollableInputStream;
14
15    match fn {
16        get_type => || gio_sys::g_unix_input_stream_get_type(),
17    }
18}
19
20pub const NONE_UNIX_INPUT_STREAM: Option<&UnixInputStream> = None;
21
22pub trait UnixInputStreamExt: 'static {
23    fn get_close_fd(&self) -> bool;
24}
25
26impl<O: IsA<UnixInputStream>> UnixInputStreamExt for O {
27    fn get_close_fd(&self) -> bool {
28        unsafe {
29            from_glib(gio_sys::g_unix_input_stream_get_close_fd(
30                self.as_ref().to_glib_none().0,
31            ))
32        }
33    }
34}
35
36impl fmt::Display for UnixInputStream {
37    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
38        write!(f, "UnixInputStream")
39    }
40}