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 crate::{ffi, FileDescriptorBased, OutputStream, PollableOutputStream};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    #[doc(alias = "GUnixOutputStream")]
10    pub struct UnixOutputStream(Object<ffi::GUnixOutputStream, ffi::GUnixOutputStreamClass>) @extends OutputStream, @implements FileDescriptorBased, PollableOutputStream;
11
12    match fn {
13        type_ => || ffi::g_unix_output_stream_get_type(),
14    }
15}
16
17impl UnixOutputStream {
18    pub const NONE: Option<&'static UnixOutputStream> = None;
19}
20
21mod sealed {
22    pub trait Sealed {}
23    impl<T: super::IsA<super::UnixOutputStream>> Sealed for T {}
24}
25
26pub trait UnixOutputStreamExt: IsA<UnixOutputStream> + sealed::Sealed + 'static {
27    #[doc(alias = "g_unix_output_stream_get_close_fd")]
28    #[doc(alias = "get_close_fd")]
29    #[doc(alias = "close-fd")]
30    fn closes_fd(&self) -> bool {
31        unsafe {
32            from_glib(ffi::g_unix_output_stream_get_close_fd(
33                self.as_ref().to_glib_none().0,
34            ))
35        }
36    }
37}
38
39impl<O: IsA<UnixOutputStream>> UnixOutputStreamExt for O {}