1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Take a look at the license at the top of the repository in the LICENSE file.

use crate::PrintOperation;
use glib::translate::*;
use std::ptr;

impl PrintOperation {
    #[doc(alias = "gtk_print_operation_get_error")]
    #[doc(alias = "get_error")]
    pub fn error(&self) -> Option<glib::Error> {
        unsafe {
            let mut error = ptr::null_mut();
            ffi::gtk_print_operation_get_error(self.to_glib_none().0, &mut error);
            if error.is_null() {
                None
            } else {
                Some(from_glib_full(error))
            }
        }
    }
}