gio/auto/
pollable_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, InputStream};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    #[doc(alias = "GPollableInputStream")]
10    pub struct PollableInputStream(Interface<ffi::GPollableInputStream, ffi::GPollableInputStreamInterface>) @requires InputStream;
11
12    match fn {
13        type_ => || ffi::g_pollable_input_stream_get_type(),
14    }
15}
16
17impl PollableInputStream {
18    pub const NONE: Option<&'static PollableInputStream> = None;
19}
20
21mod sealed {
22    pub trait Sealed {}
23    impl<T: super::IsA<super::PollableInputStream>> Sealed for T {}
24}
25
26pub trait PollableInputStreamExt: IsA<PollableInputStream> + sealed::Sealed + 'static {
27    #[doc(alias = "g_pollable_input_stream_can_poll")]
28    fn can_poll(&self) -> bool {
29        unsafe {
30            from_glib(ffi::g_pollable_input_stream_can_poll(
31                self.as_ref().to_glib_none().0,
32            ))
33        }
34    }
35
36    #[doc(alias = "g_pollable_input_stream_is_readable")]
37    fn is_readable(&self) -> bool {
38        unsafe {
39            from_glib(ffi::g_pollable_input_stream_is_readable(
40                self.as_ref().to_glib_none().0,
41            ))
42        }
43    }
44}
45
46impl<O: IsA<PollableInputStream>> PollableInputStreamExt for O {}