gio/auto/
unix_output_stream.rs1use 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
21pub trait UnixOutputStreamExt: IsA<UnixOutputStream> + 'static {
22 #[doc(alias = "g_unix_output_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_output_stream_get_close_fd(
28 self.as_ref().to_glib_none().0,
29 ))
30 }
31 }
32}
33
34impl<O: IsA<UnixOutputStream>> UnixOutputStreamExt for O {}