Skip to main content

gio_unix/auto/
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::{FileDescriptorBased, ffi};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    #[doc(alias = "GUnixInputStream")]
10    pub struct InputStream(Object<ffi::GUnixInputStream, ffi::GUnixInputStreamClass>) @extends gio::InputStream, @implements gio::PollableInputStream, FileDescriptorBased;
11
12    match fn {
13        type_ => || ffi::g_unix_input_stream_get_type(),
14    }
15}
16
17impl InputStream {
18    pub const NONE: Option<&'static InputStream> = None;
19}
20
21pub trait UnixInputStreamExt: IsA<InputStream> + '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<InputStream>> UnixInputStreamExt for O {}