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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use bitflags::bitflags;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
use std::fmt;

bitflags! {
    #[doc(alias = "SoupCacheability")]
    pub struct Cacheability: u32 {
        #[doc(alias = "SOUP_CACHE_CACHEABLE")]
        const CACHEABLE = ffi::SOUP_CACHE_CACHEABLE as u32;
        #[doc(alias = "SOUP_CACHE_UNCACHEABLE")]
        const UNCACHEABLE = ffi::SOUP_CACHE_UNCACHEABLE as u32;
        #[doc(alias = "SOUP_CACHE_INVALIDATES")]
        const INVALIDATES = ffi::SOUP_CACHE_INVALIDATES as u32;
        #[doc(alias = "SOUP_CACHE_VALIDATES")]
        const VALIDATES = ffi::SOUP_CACHE_VALIDATES as u32;
    }
}

impl fmt::Display for Cacheability {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[doc(hidden)]
impl IntoGlib for Cacheability {
    type GlibType = ffi::SoupCacheability;

    fn into_glib(self) -> ffi::SoupCacheability {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::SoupCacheability> for Cacheability {
    unsafe fn from_glib(value: ffi::SoupCacheability) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for Cacheability {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::soup_cacheability_get_type()) }
    }
}

impl glib::value::ValueType for Cacheability {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for Cacheability {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for Cacheability {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "SoupExpectation")]
    pub struct Expectation: u32 {
        #[doc(alias = "SOUP_EXPECTATION_UNRECOGNIZED")]
        const UNRECOGNIZED = ffi::SOUP_EXPECTATION_UNRECOGNIZED as u32;
        #[doc(alias = "SOUP_EXPECTATION_CONTINUE")]
        const CONTINUE = ffi::SOUP_EXPECTATION_CONTINUE as u32;
    }
}

impl fmt::Display for Expectation {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[doc(hidden)]
impl IntoGlib for Expectation {
    type GlibType = ffi::SoupExpectation;

    fn into_glib(self) -> ffi::SoupExpectation {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::SoupExpectation> for Expectation {
    unsafe fn from_glib(value: ffi::SoupExpectation) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for Expectation {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::soup_expectation_get_type()) }
    }
}

impl glib::value::ValueType for Expectation {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for Expectation {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for Expectation {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "SoupMessageFlags")]
    pub struct MessageFlags: u32 {
        #[doc(alias = "SOUP_MESSAGE_NO_REDIRECT")]
        const NO_REDIRECT = ffi::SOUP_MESSAGE_NO_REDIRECT as u32;
        #[doc(alias = "SOUP_MESSAGE_NEW_CONNECTION")]
        const NEW_CONNECTION = ffi::SOUP_MESSAGE_NEW_CONNECTION as u32;
        #[doc(alias = "SOUP_MESSAGE_IDEMPOTENT")]
        const IDEMPOTENT = ffi::SOUP_MESSAGE_IDEMPOTENT as u32;
        #[doc(alias = "SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE")]
        const DO_NOT_USE_AUTH_CACHE = ffi::SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE as u32;
        #[doc(alias = "SOUP_MESSAGE_COLLECT_METRICS")]
        const COLLECT_METRICS = ffi::SOUP_MESSAGE_COLLECT_METRICS as u32;
    }
}

impl fmt::Display for MessageFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[doc(hidden)]
impl IntoGlib for MessageFlags {
    type GlibType = ffi::SoupMessageFlags;

    fn into_glib(self) -> ffi::SoupMessageFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::SoupMessageFlags> for MessageFlags {
    unsafe fn from_glib(value: ffi::SoupMessageFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for MessageFlags {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::soup_message_flags_get_type()) }
    }
}

impl glib::value::ValueType for MessageFlags {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for MessageFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for MessageFlags {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

bitflags! {
    #[doc(alias = "SoupServerListenOptions")]
    pub struct ServerListenOptions: u32 {
        #[doc(alias = "SOUP_SERVER_LISTEN_HTTPS")]
        const HTTPS = ffi::SOUP_SERVER_LISTEN_HTTPS as u32;
        #[doc(alias = "SOUP_SERVER_LISTEN_IPV4_ONLY")]
        const IPV4_ONLY = ffi::SOUP_SERVER_LISTEN_IPV4_ONLY as u32;
        #[doc(alias = "SOUP_SERVER_LISTEN_IPV6_ONLY")]
        const IPV6_ONLY = ffi::SOUP_SERVER_LISTEN_IPV6_ONLY as u32;
    }
}

impl fmt::Display for ServerListenOptions {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[doc(hidden)]
impl IntoGlib for ServerListenOptions {
    type GlibType = ffi::SoupServerListenOptions;

    fn into_glib(self) -> ffi::SoupServerListenOptions {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::SoupServerListenOptions> for ServerListenOptions {
    unsafe fn from_glib(value: ffi::SoupServerListenOptions) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for ServerListenOptions {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::soup_server_listen_options_get_type()) }
    }
}

impl glib::value::ValueType for ServerListenOptions {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for ServerListenOptions {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for ServerListenOptions {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}