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
21pub trait PollableInputStreamExt: IsA<PollableInputStream> + 'static {
22    #[doc(alias = "g_pollable_input_stream_can_poll")]
23    fn can_poll(&self) -> bool {
24        unsafe {
25            from_glib(ffi::g_pollable_input_stream_can_poll(
26                self.as_ref().to_glib_none().0,
27            ))
28        }
29    }
30
31    #[doc(alias = "g_pollable_input_stream_is_readable")]
32    fn is_readable(&self) -> bool {
33        unsafe {
34            from_glib(ffi::g_pollable_input_stream_is_readable(
35                self.as_ref().to_glib_none().0,
36            ))
37        }
38    }
39}
40
41impl<O: IsA<PollableInputStream>> PollableInputStreamExt for O {}