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 crate::{ffi, FileDescriptorBased, InputStream, PollableInputStream};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    #[doc(alias = "GUnixInputStream")]
10    pub struct UnixInputStream(Object<ffi::GUnixInputStream, ffi::GUnixInputStreamClass>) @extends InputStream, @implements FileDescriptorBased, PollableInputStream;
11
12    match fn {
13        type_ => || ffi::g_unix_input_stream_get_type(),
14    }
15}
16
17impl UnixInputStream {
18    pub const NONE: Option<&'static UnixInputStream> = None;
19}
20
21pub trait UnixInputStreamExt: IsA<UnixInputStream> + 'static {
22    #[doc(alias = "g_unix_input_stream_get_close_fd")]
23    #[doc(alias = "get_close_fd")]
24    #[doc(alias = "close-fd")]
25    fn closes_fd(&self) -> bool {
26        unsafe {
27            from_glib(ffi::g_unix_input_stream_get_close_fd(
28                self.as_ref().to_glib_none().0,
29            ))
30        }
31    }
32}
33
34impl<O: IsA<UnixInputStream>> UnixInputStreamExt for O {}