gio/auto/
unix_output_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 OutputStream;
10use PollableOutputStream;
11
12glib_wrapper! {
13    pub struct UnixOutputStream(Object<gio_sys::GUnixOutputStream, gio_sys::GUnixOutputStreamClass, UnixOutputStreamClass>) @extends OutputStream, @implements PollableOutputStream;
14
15    match fn {
16        get_type => || gio_sys::g_unix_output_stream_get_type(),
17    }
18}
19
20pub const NONE_UNIX_OUTPUT_STREAM: Option<&UnixOutputStream> = None;
21
22pub trait UnixOutputStreamExt: 'static {
23    fn get_close_fd(&self) -> bool;
24}
25
26impl<O: IsA<UnixOutputStream>> UnixOutputStreamExt for O {
27    fn get_close_fd(&self) -> bool {
28        unsafe {
29            from_glib(gio_sys::g_unix_output_stream_get_close_fd(
30                self.as_ref().to_glib_none().0,
31            ))
32        }
33    }
34}
35
36impl fmt::Display for UnixOutputStream {
37    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
38        write!(f, "UnixOutputStream")
39    }
40}