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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

use glib::translate::*;
use std::fmt;

glib::wrapper! {
    ///
    ///
    /// ## Properties
    ///
    ///
    /// #### `key-copy-func`
    ///  Writeable | Construct Only
    ///
    ///
    /// #### `key-destroy-func`
    ///  Writeable | Construct Only
    ///
    ///
    /// #### `key-equal-func`
    ///  Writeable | Construct Only
    ///
    ///
    /// #### `key-hash-func`
    ///  Writeable | Construct Only
    ///
    ///
    /// #### `populate-callback`
    ///  Writeable | Construct Only
    ///
    ///
    /// #### `populate-callback-data`
    ///  Writeable | Construct Only
    ///
    ///
    /// #### `populate-callback-data-destroy`
    ///  Writeable | Construct Only
    ///
    ///
    /// #### `time-to-live`
    ///  This is the number of milliseconds before an item should be evicted
    /// from the cache.
    ///
    /// A value of zero indicates no eviction.
    ///
    /// Writeable | Construct Only
    ///
    ///
    /// #### `value-copy-func`
    ///  Writeable | Construct Only
    ///
    ///
    /// #### `value-destroy-func`
    ///  Writeable | Construct Only
    ///
    /// # Implements
    ///
    /// [`trait@glib::ObjectExt`]
    #[doc(alias = "DzlTaskCache")]
    pub struct TaskCache(Object<ffi::DzlTaskCache, ffi::DzlTaskCacheClass>);

    match fn {
        type_ => || ffi::dzl_task_cache_get_type(),
    }
}

impl TaskCache {
    //#[doc(alias = "dzl_task_cache_new")]
    //pub fn new<P: Fn() -> u32 + 'static, Q: Fn() + 'static, R: Fn() + 'static>(key_hash_func: P, key_equal_func: /*Unimplemented*/Fn(/*Unimplemented*/Option<Basic: Pointer>) -> bool, key_copy_func: /*Unimplemented*/Fn() -> /*Unimplemented*/Basic: Pointer, key_destroy_func: Q, value_copy_func: /*Unimplemented*/Fn() -> /*Unimplemented*/Basic: Pointer, value_free_func: R, time_to_live_msec: i64, populate_callback: /*Unimplemented*/Fn(&TaskCache, /*Unimplemented*/Option<Basic: Pointer>, /*Ignored*/gio::Task), populate_callback_data: /*Unimplemented*/Option<Basic: Pointer>) -> TaskCache {
    //    unsafe { TODO: call ffi:dzl_task_cache_new() }
    //}

    //#[doc(alias = "dzl_task_cache_evict")]
    //pub fn evict(&self, key: /*Unimplemented*/Option<Basic: Pointer>) -> bool {
    //    unsafe { TODO: call ffi:dzl_task_cache_evict() }
    //}

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

    //#[doc(alias = "dzl_task_cache_get_async")]
    //#[doc(alias = "get_async")]
    //pub fn async_<P: FnOnce(Result</*Unimplemented*/Option<Basic: Pointer>, glib::Error>) + 'static>(&self, key: /*Unimplemented*/Option<Basic: Pointer>, force_update: bool, cancellable: Option<&impl IsA<gio::Cancellable>>, callback: P) {
    //    unsafe { TODO: call ffi:dzl_task_cache_get_async() }
    //}

    //
    //pub fn async__future(&self, key: /*Unimplemented*/Option<Basic: Pointer>, force_update: bool) -> Pin<Box_<dyn std::future::Future<Output = Result</*Unimplemented*/Option<Basic: Pointer>, glib::Error>> + 'static>> {

    //let key = key.map(ToOwned::to_owned);
    //Box_::pin(gio::GioFuture::new(self, move |obj, cancellable, send| {
    //    obj.async_(
    //        key.as_ref().map(::std::borrow::Borrow::borrow),
    //        force_update,
    //        Some(cancellable),
    //        move |res| {
    //            send.resolve(res);
    //        },
    //    );
    //}))
    //}

    //#[doc(alias = "dzl_task_cache_get_values")]
    //#[doc(alias = "get_values")]
    //pub fn values(&self) -> /*Unimplemented*/Vec<Basic: Pointer> {
    //    unsafe { TODO: call ffi:dzl_task_cache_get_values() }
    //}

    //#[doc(alias = "dzl_task_cache_peek")]
    //pub fn peek(&self, key: /*Unimplemented*/Option<Basic: Pointer>) -> Option<glib::Object> {
    //    unsafe { TODO: call ffi:dzl_task_cache_peek() }
    //}

    #[doc(alias = "dzl_task_cache_set_name")]
    pub fn set_name(&self, name: &str) {
        unsafe {
            ffi::dzl_task_cache_set_name(self.to_glib_none().0, name.to_glib_none().0);
        }
    }
}

impl fmt::Display for TaskCache {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("TaskCache")
    }
}