1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// This file was generated by gir (https://github.com/gtk-rs/gir)
// DO NOT EDIT

use glib::{translate::*};

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct Iterator(Shared<ffi::WpIterator>);

    match fn {
        ref => |ptr| ffi::wp_iterator_ref(ptr),
        unref => |ptr| ffi::wp_iterator_unref(ptr),
        type_ => || ffi::wp_iterator_get_type(),
    }
}

impl Iterator {
    #[doc(alias = "wp_iterator_next")]
    pub fn next(&self) -> Option<glib::Value> {
        unsafe {
            let mut item = glib::Value::uninitialized();
            let ret = from_glib(ffi::wp_iterator_next(self.to_glib_none().0, item.to_glib_none_mut().0));
            if ret { Some(item) } else { None }
        }
    }

    #[doc(alias = "wp_iterator_reset")]
    pub fn reset(&self) {
        unsafe {
            ffi::wp_iterator_reset(self.to_glib_none().0);
        }
    }
}