glib/auto/flags.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::{bitflags::bitflags, ffi, prelude::*, translate::*};
6
7#[cfg(feature = "v2_66")]
8bitflags! {
9 /// Flags to pass to g_file_set_contents_full() to affect its safety and
10 /// performance.
11 #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
12 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
13 #[doc(alias = "GFileSetContentsFlags")]
14 pub struct FileSetContentsFlags: u32 {
15 /// No guarantees about file consistency or durability.
16 /// The most dangerous setting, which is slightly faster than other settings.
17 #[doc(alias = "G_FILE_SET_CONTENTS_NONE")]
18 const NONE = ffi::G_FILE_SET_CONTENTS_NONE as _;
19 /// Guarantee file consistency: after a crash,
20 /// either the old version of the file or the new version of the file will be
21 /// available, but not a mixture. On Unix systems this equates to an `fsync()`
22 /// on the file and use of an atomic `rename()` of the new version of the file
23 /// over the old.
24 #[doc(alias = "G_FILE_SET_CONTENTS_CONSISTENT")]
25 const CONSISTENT = ffi::G_FILE_SET_CONTENTS_CONSISTENT as _;
26 /// Guarantee file durability: after a crash, the
27 /// new version of the file will be available. On Unix systems this equates to
28 /// an `fsync()` on the file (if [`CONSISTENT`][Self::CONSISTENT] is unset), or
29 /// the effects of [`CONSISTENT`][Self::CONSISTENT] plus an `fsync()` on the
30 /// directory containing the file after calling `rename()`.
31 #[doc(alias = "G_FILE_SET_CONTENTS_DURABLE")]
32 const DURABLE = ffi::G_FILE_SET_CONTENTS_DURABLE as _;
33 /// t currently exist, but may result in a corrupted version
34 /// of the new file if the system crashes while writing it.
35 #[doc(alias = "G_FILE_SET_CONTENTS_ONLY_EXISTING")]
36 const ONLY_EXISTING = ffi::G_FILE_SET_CONTENTS_ONLY_EXISTING as _;
37 }
38}
39
40#[cfg(feature = "v2_66")]
41#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
42#[doc(hidden)]
43impl IntoGlib for FileSetContentsFlags {
44 type GlibType = ffi::GFileSetContentsFlags;
45
46 #[inline]
47 fn into_glib(self) -> ffi::GFileSetContentsFlags {
48 self.bits()
49 }
50}
51
52#[cfg(feature = "v2_66")]
53#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
54#[doc(hidden)]
55impl FromGlib<ffi::GFileSetContentsFlags> for FileSetContentsFlags {
56 #[inline]
57 unsafe fn from_glib(value: ffi::GFileSetContentsFlags) -> Self {
58 Self::from_bits_truncate(value)
59 }
60}
61
62bitflags! {
63 /// A test to perform on a file using g_file_test().
64 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
65 #[doc(alias = "GFileTest")]
66 pub(crate) struct FileTest: u32 {
67 /// [`true`] if the file is a regular file
68 /// (not a directory). Note that this test will also return [`true`]
69 /// if the tested file is a symlink to a regular file.
70 #[doc(alias = "G_FILE_TEST_IS_REGULAR")]
71 const IS_REGULAR = ffi::G_FILE_TEST_IS_REGULAR as _;
72 /// [`true`] if the file is a symlink.
73 #[doc(alias = "G_FILE_TEST_IS_SYMLINK")]
74 const IS_SYMLINK = ffi::G_FILE_TEST_IS_SYMLINK as _;
75 /// [`true`] if the file is a directory.
76 #[doc(alias = "G_FILE_TEST_IS_DIR")]
77 const IS_DIR = ffi::G_FILE_TEST_IS_DIR as _;
78 /// [`true`] if the file is executable.
79 #[doc(alias = "G_FILE_TEST_IS_EXECUTABLE")]
80 const IS_EXECUTABLE = ffi::G_FILE_TEST_IS_EXECUTABLE as _;
81 /// [`true`] if the file exists. It may or may not
82 /// be a regular file.
83 #[doc(alias = "G_FILE_TEST_EXISTS")]
84 const EXISTS = ffi::G_FILE_TEST_EXISTS as _;
85 }
86}
87
88#[doc(hidden)]
89impl IntoGlib for FileTest {
90 type GlibType = ffi::GFileTest;
91
92 #[inline]
93 fn into_glib(self) -> ffi::GFileTest {
94 self.bits()
95 }
96}
97
98#[doc(hidden)]
99impl FromGlib<ffi::GFileTest> for FileTest {
100 #[inline]
101 unsafe fn from_glib(value: ffi::GFileTest) -> Self {
102 Self::from_bits_truncate(value)
103 }
104}
105
106bitflags! {
107 /// Flags to modify the format of the string returned by g_format_size_full().
108 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
109 #[doc(alias = "GFormatSizeFlags")]
110 pub struct FormatSizeFlags: u32 {
111 /// behave the same as g_format_size()
112 #[doc(alias = "G_FORMAT_SIZE_DEFAULT")]
113 const DEFAULT = ffi::G_FORMAT_SIZE_DEFAULT as _;
114 /// include the exact number of bytes as part
115 /// of the returned string. For example, "45.6 kB (45,612 bytes)".
116 #[doc(alias = "G_FORMAT_SIZE_LONG_FORMAT")]
117 const LONG_FORMAT = ffi::G_FORMAT_SIZE_LONG_FORMAT as _;
118 /// use IEC (base 1024) units with "KiB"-style
119 /// suffixes. IEC units should only be used for reporting things with
120 /// a strong "power of 2" basis, like RAM sizes or RAID stripe sizes.
121 /// Network and storage sizes should be reported in the normal SI units.
122 #[doc(alias = "G_FORMAT_SIZE_IEC_UNITS")]
123 const IEC_UNITS = ffi::G_FORMAT_SIZE_IEC_UNITS as _;
124 /// .
125 #[doc(alias = "G_FORMAT_SIZE_BITS")]
126 const BITS = ffi::G_FORMAT_SIZE_BITS as _;
127 /// return only value, without unit; this should
128 /// not be used together with @G_FORMAT_SIZE_LONG_FORMAT
129 /// nor @G_FORMAT_SIZE_ONLY_UNIT. Since: 2.74
130 #[cfg(feature = "v2_74")]
131 #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
132 #[doc(alias = "G_FORMAT_SIZE_ONLY_VALUE")]
133 const ONLY_VALUE = ffi::G_FORMAT_SIZE_ONLY_VALUE as _;
134 /// return only unit, without value; this should
135 /// not be used together with @G_FORMAT_SIZE_LONG_FORMAT
136 /// nor @G_FORMAT_SIZE_ONLY_VALUE. Since: 2.74
137 #[cfg(feature = "v2_74")]
138 #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
139 #[doc(alias = "G_FORMAT_SIZE_ONLY_UNIT")]
140 const ONLY_UNIT = ffi::G_FORMAT_SIZE_ONLY_UNIT as _;
141 }
142}
143
144#[doc(hidden)]
145impl IntoGlib for FormatSizeFlags {
146 type GlibType = ffi::GFormatSizeFlags;
147
148 #[inline]
149 fn into_glib(self) -> ffi::GFormatSizeFlags {
150 self.bits()
151 }
152}
153
154#[doc(hidden)]
155impl FromGlib<ffi::GFormatSizeFlags> for FormatSizeFlags {
156 #[inline]
157 unsafe fn from_glib(value: ffi::GFormatSizeFlags) -> Self {
158 Self::from_bits_truncate(value)
159 }
160}
161
162bitflags! {
163 /// A bitwise combination representing a condition to watch for on an
164 /// event source.
165 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
166 #[doc(alias = "GIOCondition")]
167 pub struct IOCondition: u32 {
168 /// There is data to read.
169 #[doc(alias = "G_IO_IN")]
170 const IN = ffi::G_IO_IN as _;
171 /// Data can be written (without blocking).
172 #[doc(alias = "G_IO_OUT")]
173 const OUT = ffi::G_IO_OUT as _;
174 /// There is urgent data to read.
175 #[doc(alias = "G_IO_PRI")]
176 const PRI = ffi::G_IO_PRI as _;
177 /// Error condition.
178 #[doc(alias = "G_IO_ERR")]
179 const ERR = ffi::G_IO_ERR as _;
180 /// Hung up (the connection has been broken, usually for
181 /// pipes and sockets).
182 #[doc(alias = "G_IO_HUP")]
183 const HUP = ffi::G_IO_HUP as _;
184 /// Invalid request. The file descriptor is not open.
185 #[doc(alias = "G_IO_NVAL")]
186 const NVAL = ffi::G_IO_NVAL as _;
187 }
188}
189
190#[doc(hidden)]
191impl IntoGlib for IOCondition {
192 type GlibType = ffi::GIOCondition;
193
194 #[inline]
195 fn into_glib(self) -> ffi::GIOCondition {
196 self.bits()
197 }
198}
199
200#[doc(hidden)]
201impl FromGlib<ffi::GIOCondition> for IOCondition {
202 #[inline]
203 unsafe fn from_glib(value: ffi::GIOCondition) -> Self {
204 Self::from_bits_truncate(value)
205 }
206}
207
208impl StaticType for IOCondition {
209 #[inline]
210 #[doc(alias = "g_io_condition_get_type")]
211 fn static_type() -> crate::Type {
212 unsafe { from_glib(ffi::g_io_condition_get_type()) }
213 }
214}
215
216impl crate::HasParamSpec for IOCondition {
217 type ParamSpec = crate::ParamSpecFlags;
218 type SetValue = Self;
219 type BuilderFn = fn(&str) -> crate::ParamSpecFlagsBuilder<Self>;
220
221 fn param_spec_builder() -> Self::BuilderFn {
222 Self::ParamSpec::builder
223 }
224}
225
226impl crate::value::ValueType for IOCondition {
227 type Type = Self;
228}
229
230unsafe impl<'a> crate::value::FromValue<'a> for IOCondition {
231 type Checker = crate::value::GenericValueTypeChecker<Self>;
232
233 #[inline]
234 unsafe fn from_value(value: &'a crate::Value) -> Self {
235 unsafe {
236 from_glib(crate::gobject_ffi::g_value_get_flags(
237 value.to_glib_none().0,
238 ))
239 }
240 }
241}
242
243impl ToValue for IOCondition {
244 #[inline]
245 fn to_value(&self) -> crate::Value {
246 let mut value = crate::Value::for_value_type::<Self>();
247 unsafe {
248 crate::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
249 }
250 value
251 }
252
253 #[inline]
254 fn value_type(&self) -> crate::Type {
255 Self::static_type()
256 }
257}
258
259impl From<IOCondition> for crate::Value {
260 #[inline]
261 fn from(v: IOCondition) -> Self {
262 ToValue::to_value(&v)
263 }
264}
265
266bitflags! {
267 /// Flags which influence the parsing.
268 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
269 #[doc(alias = "GKeyFileFlags")]
270 pub struct KeyFileFlags: u32 {
271 /// No flags, default behaviour
272 #[doc(alias = "G_KEY_FILE_NONE")]
273 const NONE = ffi::G_KEY_FILE_NONE as _;
274 /// Use this flag if you plan to write the
275 /// (possibly modified) contents of the key file back to a file;
276 /// otherwise all comments will be lost when the key file is
277 /// written back.
278 #[doc(alias = "G_KEY_FILE_KEEP_COMMENTS")]
279 const KEEP_COMMENTS = ffi::G_KEY_FILE_KEEP_COMMENTS as _;
280 /// Use this flag if you plan to write the
281 /// (possibly modified) contents of the key file back to a file;
282 /// otherwise only the translations for the current language will be
283 /// written back.
284 #[doc(alias = "G_KEY_FILE_KEEP_TRANSLATIONS")]
285 const KEEP_TRANSLATIONS = ffi::G_KEY_FILE_KEEP_TRANSLATIONS as _;
286 }
287}
288
289#[doc(hidden)]
290impl IntoGlib for KeyFileFlags {
291 type GlibType = ffi::GKeyFileFlags;
292
293 #[inline]
294 fn into_glib(self) -> ffi::GKeyFileFlags {
295 self.bits()
296 }
297}
298
299#[doc(hidden)]
300impl FromGlib<ffi::GKeyFileFlags> for KeyFileFlags {
301 #[inline]
302 unsafe fn from_glib(value: ffi::GKeyFileFlags) -> Self {
303 Self::from_bits_truncate(value)
304 }
305}
306
307bitflags! {
308 /// Flags specifying the level of log messages.
309 ///
310 /// It is possible to change how GLib treats messages of the various
311 /// levels using `log_set_handler()` and `log_set_fatal_mask()`.
312 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
313 #[doc(alias = "GLogLevelFlags")]
314 pub struct LogLevelFlags: u32 {
315 /// internal flag
316 #[doc(alias = "G_LOG_FLAG_RECURSION")]
317 const FLAG_RECURSION = ffi::G_LOG_FLAG_RECURSION as _;
318 /// internal flag
319 #[doc(alias = "G_LOG_FLAG_FATAL")]
320 const FLAG_FATAL = ffi::G_LOG_FLAG_FATAL as _;
321 /// log level for errors, see `error()`.
322 /// This level is also used for messages produced by `assert()`.
323 #[doc(alias = "G_LOG_LEVEL_ERROR")]
324 const LEVEL_ERROR = ffi::G_LOG_LEVEL_ERROR as _;
325 /// log level for critical warning messages, see
326 /// `critical()`. This level is also used for messages produced by
327 /// `return_if_fail()` and `return_val_if_fail()`.
328 #[doc(alias = "G_LOG_LEVEL_CRITICAL")]
329 const LEVEL_CRITICAL = ffi::G_LOG_LEVEL_CRITICAL as _;
330 /// log level for warnings, see `warning()`
331 #[doc(alias = "G_LOG_LEVEL_WARNING")]
332 const LEVEL_WARNING = ffi::G_LOG_LEVEL_WARNING as _;
333 /// log level for messages, see `message()`
334 #[doc(alias = "G_LOG_LEVEL_MESSAGE")]
335 const LEVEL_MESSAGE = ffi::G_LOG_LEVEL_MESSAGE as _;
336 /// log level for informational messages, see `info()`
337 #[doc(alias = "G_LOG_LEVEL_INFO")]
338 const LEVEL_INFO = ffi::G_LOG_LEVEL_INFO as _;
339 /// log level for debug messages, see `debug()`
340 #[doc(alias = "G_LOG_LEVEL_DEBUG")]
341 const LEVEL_DEBUG = ffi::G_LOG_LEVEL_DEBUG as _;
342 /// a mask including all log levels
343 #[doc(alias = "G_LOG_LEVEL_MASK")]
344 const LEVEL_MASK = ffi::G_LOG_LEVEL_MASK as _;
345 }
346}
347
348#[doc(hidden)]
349impl IntoGlib for LogLevelFlags {
350 type GlibType = ffi::GLogLevelFlags;
351
352 #[inline]
353 fn into_glib(self) -> ffi::GLogLevelFlags {
354 self.bits()
355 }
356}
357
358#[doc(hidden)]
359impl FromGlib<ffi::GLogLevelFlags> for LogLevelFlags {
360 #[inline]
361 unsafe fn from_glib(value: ffi::GLogLevelFlags) -> Self {
362 Self::from_bits_truncate(value)
363 }
364}
365
366#[cfg(feature = "v2_72")]
367bitflags! {
368 /// Flags to pass to `GLib::MainContext::new_with_flags()` which affect the
369 /// behaviour of a [`MainContext`][crate::MainContext].
370 #[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
371 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
372 #[doc(alias = "GMainContextFlags")]
373 pub struct MainContextFlags: u32 {
374 /// Default behaviour.
375 #[doc(alias = "G_MAIN_CONTEXT_FLAGS_NONE")]
376 const NONE = ffi::G_MAIN_CONTEXT_FLAGS_NONE as _;
377 /// Assume that polling for events will
378 /// free the thread to process other jobs. That's useful if you're using
379 /// `g_main_context_{prepare,query,check,dispatch}` to integrate GMainContext in
380 /// other event loops.
381 #[doc(alias = "G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING")]
382 const OWNERLESS_POLLING = ffi::G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING as _;
383 }
384}
385
386#[cfg(feature = "v2_72")]
387#[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
388#[doc(hidden)]
389impl IntoGlib for MainContextFlags {
390 type GlibType = ffi::GMainContextFlags;
391
392 #[inline]
393 fn into_glib(self) -> ffi::GMainContextFlags {
394 self.bits()
395 }
396}
397
398#[cfg(feature = "v2_72")]
399#[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
400#[doc(hidden)]
401impl FromGlib<ffi::GMainContextFlags> for MainContextFlags {
402 #[inline]
403 unsafe fn from_glib(value: ffi::GMainContextFlags) -> Self {
404 Self::from_bits_truncate(value)
405 }
406}
407
408bitflags! {
409 /// Flags which modify individual options.
410 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
411 #[doc(alias = "GOptionFlags")]
412 pub struct OptionFlags: u32 {
413 /// No flags.
414 #[doc(alias = "G_OPTION_FLAG_NONE")]
415 const NONE = ffi::G_OPTION_FLAG_NONE as _;
416 /// The option doesn't appear in `--help` output.
417 #[doc(alias = "G_OPTION_FLAG_HIDDEN")]
418 const HIDDEN = ffi::G_OPTION_FLAG_HIDDEN as _;
419 /// The option appears in the main section of the
420 /// `--help` output, even if it is defined in a group.
421 #[doc(alias = "G_OPTION_FLAG_IN_MAIN")]
422 const IN_MAIN = ffi::G_OPTION_FLAG_IN_MAIN as _;
423 /// For options of the [`OptionArg::None`][crate::OptionArg::None] kind, this
424 /// flag indicates that the sense of the option is reversed. i.e. [`false`] will
425 /// be stored into the argument rather than [`true`].
426 #[doc(alias = "G_OPTION_FLAG_REVERSE")]
427 const REVERSE = ffi::G_OPTION_FLAG_REVERSE as _;
428 /// For options of the [`OptionArg::Callback`][crate::OptionArg::Callback] kind,
429 /// this flag indicates that the callback does not take any argument
430 /// (like a [`OptionArg::None`][crate::OptionArg::None] option). Since 2.8
431 #[doc(alias = "G_OPTION_FLAG_NO_ARG")]
432 const NO_ARG = ffi::G_OPTION_FLAG_NO_ARG as _;
433 /// For options of the [`OptionArg::Callback`][crate::OptionArg::Callback]
434 /// kind, this flag indicates that the argument should be passed to the
435 /// callback in the GLib filename encoding rather than UTF-8. Since 2.8
436 #[doc(alias = "G_OPTION_FLAG_FILENAME")]
437 const FILENAME = ffi::G_OPTION_FLAG_FILENAME as _;
438 /// For options of the [`OptionArg::Callback`][crate::OptionArg::Callback]
439 /// kind, this flag indicates that the argument supply is optional.
440 /// If no argument is given then data of `GOptionParseFunc` will be
441 /// set to NULL. Since 2.8
442 #[doc(alias = "G_OPTION_FLAG_OPTIONAL_ARG")]
443 const OPTIONAL_ARG = ffi::G_OPTION_FLAG_OPTIONAL_ARG as _;
444 /// This flag turns off the automatic conflict
445 /// resolution which prefixes long option names with `groupname-` if
446 /// there is a conflict. This option should only be used in situations
447 /// where aliasing is necessary to model some legacy commandline interface.
448 /// It is not safe to use this option, unless all option groups are under
449 /// your direct control. Since 2.8.
450 #[doc(alias = "G_OPTION_FLAG_NOALIAS")]
451 const NOALIAS = ffi::G_OPTION_FLAG_NOALIAS as _;
452 /// This flag marks the option as deprecated in the `--help`.
453 ///
454 /// You should update the description of the option to describe what
455 /// the user should do in response to the deprecation, for instance:
456 /// remove the option, or replace it with another one.
457 #[cfg(feature = "v2_84")]
458 #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))]
459 #[doc(alias = "G_OPTION_FLAG_DEPRECATED")]
460 const DEPRECATED = ffi::G_OPTION_FLAG_DEPRECATED as _;
461 }
462}
463
464#[doc(hidden)]
465impl IntoGlib for OptionFlags {
466 type GlibType = ffi::GOptionFlags;
467
468 #[inline]
469 fn into_glib(self) -> ffi::GOptionFlags {
470 self.bits()
471 }
472}
473
474#[doc(hidden)]
475impl FromGlib<ffi::GOptionFlags> for OptionFlags {
476 #[inline]
477 unsafe fn from_glib(value: ffi::GOptionFlags) -> Self {
478 Self::from_bits_truncate(value)
479 }
480}
481
482bitflags! {
483 /// Flags specifying compile-time options.
484 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
485 #[doc(alias = "GRegexCompileFlags")]
486 pub struct RegexCompileFlags: u32 {
487 /// No special options set. Since: 2.74
488 #[doc(alias = "G_REGEX_DEFAULT")]
489 const DEFAULT = ffi::G_REGEX_DEFAULT as _;
490 /// Letters in the pattern match both upper- and
491 /// lowercase letters. This option can be changed within a pattern
492 /// by a `(?i)` option setting.
493 #[doc(alias = "G_REGEX_CASELESS")]
494 const CASELESS = ffi::G_REGEX_CASELESS as _;
495 /// constructs match immediately following or immediately before
496 /// any newline in the string, respectively, as well as at the very start
497 /// and end. This can be changed within a pattern by a `(?m)` option
498 /// setting.
499 #[doc(alias = "G_REGEX_MULTILINE")]
500 const MULTILINE = ffi::G_REGEX_MULTILINE as _;
501 /// A dot metacharacter (`.`) in the pattern matches all
502 /// characters, including newlines. Without it, newlines are excluded.
503 /// This option can be changed within a pattern by a `(?s)` option setting.
504 #[doc(alias = "G_REGEX_DOTALL")]
505 const DOTALL = ffi::G_REGEX_DOTALL as _;
506 /// Whitespace data characters in the pattern are
507 /// totally ignored except when escaped or inside a character class.
508 /// Whitespace does not include the VT character (code 11). In addition,
509 /// characters between an unescaped `#` outside a character class and
510 /// the next newline character, inclusive, are also ignored. This can
511 /// be changed within a pattern by a `(?x)` option setting.
512 #[doc(alias = "G_REGEX_EXTENDED")]
513 const EXTENDED = ffi::G_REGEX_EXTENDED as _;
514 /// , that is,
515 /// it is constrained to match only at the first matching point in the
516 /// string that is being searched. This effect can also be achieved by
517 /// appropriate constructs in the pattern itself such as the `^`
518 /// metacharacter.
519 #[doc(alias = "G_REGEX_ANCHORED")]
520 const ANCHORED = ffi::G_REGEX_ANCHORED as _;
521 /// A dollar metacharacter (`$`) in the pattern
522 /// matches only at the end of the string. Without this option, a
523 /// dollar also matches immediately before the final character if
524 /// it is a newline (but not before any other newlines). This option
525 /// is ignored if [flags@GLib.RegexCompileFlags.MULTILINE] is set.
526 #[doc(alias = "G_REGEX_DOLLAR_ENDONLY")]
527 const DOLLAR_ENDONLY = ffi::G_REGEX_DOLLAR_ENDONLY as _;
528 /// of the quantifiers so that
529 /// they are not greedy by default, but become greedy if followed by `?`.
530 /// It can also be set by a `(?U)` option setting within the pattern.
531 #[doc(alias = "G_REGEX_UNGREEDY")]
532 const UNGREEDY = ffi::G_REGEX_UNGREEDY as _;
533 /// Usually strings must be valid UTF-8 strings, using this
534 /// flag they are considered as a raw sequence of bytes.
535 #[doc(alias = "G_REGEX_RAW")]
536 const RAW = ffi::G_REGEX_RAW as _;
537 /// Disables the use of numbered capturing
538 /// parentheses in the pattern. Any opening parenthesis that is not
539 /// followed by `?` behaves as if it were followed by `?:` but named
540 /// parentheses can still be used for capturing (and they acquire numbers
541 /// in the usual way).
542 #[doc(alias = "G_REGEX_NO_AUTO_CAPTURE")]
543 const NO_AUTO_CAPTURE = ffi::G_REGEX_NO_AUTO_CAPTURE as _;
544 /// Since 2.74 and the port to pcre2, requests JIT
545 /// compilation, which, if the just-in-time compiler is available, further
546 /// processes a compiled pattern into machine code that executes much
547 /// faster. However, it comes at the cost of extra processing before the
548 /// match is performed, so it is most beneficial to use this when the same
549 /// compiled pattern is used for matching many times. Before 2.74 this
550 /// option used the built-in non-JIT optimizations in pcre1.
551 #[doc(alias = "G_REGEX_OPTIMIZE")]
552 const OPTIMIZE = ffi::G_REGEX_OPTIMIZE as _;
553 /// Limits an unanchored pattern to match before (or at) the
554 /// first newline. Since: 2.34
555 #[doc(alias = "G_REGEX_FIRSTLINE")]
556 const FIRSTLINE = ffi::G_REGEX_FIRSTLINE as _;
557 /// Names used to identify capturing subpatterns need not
558 /// be unique. This can be helpful for certain types of pattern when it
559 /// is known that only one instance of the named subpattern can ever be
560 /// matched.
561 #[doc(alias = "G_REGEX_DUPNAMES")]
562 const DUPNAMES = ffi::G_REGEX_DUPNAMES as _;
563 /// Usually any newline character or character sequence is
564 /// recognized. If this option is set, the only recognized newline character
565 /// is `\r`.
566 #[doc(alias = "G_REGEX_NEWLINE_CR")]
567 const NEWLINE_CR = ffi::G_REGEX_NEWLINE_CR as _;
568 /// Usually any newline character or character sequence is
569 /// recognized. If this option is set, the only recognized newline character
570 /// is `\n`.
571 #[doc(alias = "G_REGEX_NEWLINE_LF")]
572 const NEWLINE_LF = ffi::G_REGEX_NEWLINE_LF as _;
573 #[doc(alias = "G_REGEX_NEWLINE_RESERVED1")]
574 const NEWLINE_RESERVED1 = ffi::G_REGEX_NEWLINE_RESERVED1 as _;
575 }
576}
577
578#[doc(hidden)]
579impl IntoGlib for RegexCompileFlags {
580 type GlibType = ffi::GRegexCompileFlags;
581
582 #[inline]
583 fn into_glib(self) -> ffi::GRegexCompileFlags {
584 self.bits()
585 }
586}
587
588#[doc(hidden)]
589impl FromGlib<ffi::GRegexCompileFlags> for RegexCompileFlags {
590 #[inline]
591 unsafe fn from_glib(value: ffi::GRegexCompileFlags) -> Self {
592 Self::from_bits_truncate(value)
593 }
594}
595
596bitflags! {
597 /// Flags specifying match-time options.
598 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
599 #[doc(alias = "GRegexMatchFlags")]
600 pub struct RegexMatchFlags: u32 {
601 /// No special options set. Since: 2.74
602 #[doc(alias = "G_REGEX_MATCH_DEFAULT")]
603 const DEFAULT = ffi::G_REGEX_MATCH_DEFAULT as _;
604 /// , that is,
605 /// it is constrained to match only at the first matching point in the
606 /// string that is being searched. This effect can also be achieved by
607 /// appropriate constructs in the pattern itself such as the `^`
608 /// metacharacter.
609 #[doc(alias = "G_REGEX_MATCH_ANCHORED")]
610 const ANCHORED = ffi::G_REGEX_MATCH_ANCHORED as _;
611 /// Specifies that first character of the string is
612 /// not the beginning of a line, so the circumflex metacharacter should
613 /// not match before it. Setting this without
614 /// [flags@GLib.RegexCompileFlags.MULTILINE] (at
615 /// compile time) causes circumflex never to match. This option affects
616 /// only the behaviour of the circumflex metacharacter, it does not
617 /// affect `\A`.
618 #[doc(alias = "G_REGEX_MATCH_NOTBOL")]
619 const NOTBOL = ffi::G_REGEX_MATCH_NOTBOL as _;
620 /// Specifies that the end of the subject string is
621 /// not the end of a line, so the dollar metacharacter should not match
622 /// it nor (except in multiline mode) a newline immediately before it.
623 /// Setting this without [flags@GLib.RegexCompileFlags.MULTILINE]
624 /// (at compile time) causes dollar never to match. This option affects only
625 /// the behaviour of the dollar metacharacter, it does not affect `\Z` or `\z`.
626 #[doc(alias = "G_REGEX_MATCH_NOTEOL")]
627 const NOTEOL = ffi::G_REGEX_MATCH_NOTEOL as _;
628 /// An empty string is not considered to be a valid
629 /// match if this option is set. If there are alternatives in the pattern,
630 /// they are tried. If all the alternatives match the empty string, the
631 /// entire match fails. For example, if the pattern `a?b?` is applied to
632 /// a string not beginning with `a` or `b`, it matches the empty string
633 /// at the start of the string. With this flag set, this match is not
634 /// valid, so [type@GLib.Regex] searches further into the string for
635 /// occurrences of `a` or `b`.
636 #[doc(alias = "G_REGEX_MATCH_NOTEMPTY")]
637 const NOTEMPTY = ffi::G_REGEX_MATCH_NOTEMPTY as _;
638 /// Turns on the partial matching feature, for more
639 /// documentation on partial matching see
640 /// [`MatchInfo::is_partial_match()`][crate::MatchInfo::is_partial_match()].
641 #[doc(alias = "G_REGEX_MATCH_PARTIAL")]
642 const PARTIAL = ffi::G_REGEX_MATCH_PARTIAL as _;
643 /// Overrides the newline definition set when
644 /// creating a new [type@GLib.Regex], setting the `\r` character as line
645 /// terminator.
646 #[doc(alias = "G_REGEX_MATCH_NEWLINE_CR")]
647 const NEWLINE_CR = ffi::G_REGEX_MATCH_NEWLINE_CR as _;
648 /// Overrides the newline definition set when
649 /// creating a new [type@GLib.Regex], setting the `\n` character as line
650 /// terminator.
651 #[doc(alias = "G_REGEX_MATCH_NEWLINE_LF")]
652 const NEWLINE_LF = ffi::G_REGEX_MATCH_NEWLINE_LF as _;
653 /// Overrides the newline definition set when
654 /// creating a new [type@GLib.Regex], setting the `\r\n` character sequence as
655 /// line terminator.
656 #[doc(alias = "G_REGEX_MATCH_NEWLINE_CRLF")]
657 const NEWLINE_CRLF = ffi::G_REGEX_MATCH_NEWLINE_CRLF as _;
658 /// Overrides the newline definition set when
659 /// creating a new [type@GLib.Regex], any Unicode newline sequence
660 /// is recognised as a newline. These are `\r`, `\n` and `\r\n`, and the
661 /// single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
662 /// U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
663 /// U+2029 PARAGRAPH SEPARATOR.
664 #[doc(alias = "G_REGEX_MATCH_NEWLINE_ANY")]
665 const NEWLINE_ANY = ffi::G_REGEX_MATCH_NEWLINE_ANY as _;
666 /// Overrides the newline definition set when
667 /// creating a new [type@GLib.Regex]; any `\r`, `\n`, or `\r\n` character
668 /// sequence is recognized as a newline. Since: 2.34
669 #[doc(alias = "G_REGEX_MATCH_NEWLINE_ANYCRLF")]
670 const NEWLINE_ANYCRLF = ffi::G_REGEX_MATCH_NEWLINE_ANYCRLF as _;
671 /// Overrides the newline definition for `\R` set when
672 /// creating a new [type@GLib.Regex]; only `\r`, `\n`, or `\r\n` character
673 /// sequences are recognized as a newline by `\R`. Since: 2.34
674 #[doc(alias = "G_REGEX_MATCH_BSR_ANYCRLF")]
675 const BSR_ANYCRLF = ffi::G_REGEX_MATCH_BSR_ANYCRLF as _;
676 /// Overrides the newline definition for `\R` set when
677 /// creating a new [type@GLib.Regex]; any Unicode newline characters or
678 /// character sequences are recognized as a newline by `\R`. These are `\r`,
679 /// `\n` and `\r\n`, and the single characters U+000B LINE TABULATION,
680 /// U+000C FORM FEED (FF), U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
681 /// U+2029 PARAGRAPH SEPARATOR. Since: 2.34
682 #[doc(alias = "G_REGEX_MATCH_BSR_ANY")]
683 const BSR_ANY = ffi::G_REGEX_MATCH_BSR_ANY as _;
684 /// An alias for [flags@GLib.RegexMatchFlags.PARTIAL].
685 /// Since: 2.34
686 #[doc(alias = "G_REGEX_MATCH_PARTIAL_SOFT")]
687 const PARTIAL_SOFT = ffi::G_REGEX_MATCH_PARTIAL_SOFT as _;
688 /// Turns on the partial matching feature. In
689 /// contrast to [flags@GLib.RegexMatchFlags.PARTIAL_SOFT], this stops matching
690 /// as soon as a partial match is found, without continuing to search for a
691 /// possible complete match. See [`MatchInfo::is_partial_match()`][crate::MatchInfo::is_partial_match()] for
692 /// more information. Since: 2.34
693 #[doc(alias = "G_REGEX_MATCH_PARTIAL_HARD")]
694 const PARTIAL_HARD = ffi::G_REGEX_MATCH_PARTIAL_HARD as _;
695 /// Like [flags@GLib.RegexMatchFlags.NOTEMPTY],
696 /// but only applied to the start of the matched string. For anchored
697 /// patterns this can only happen for pattern containing `\K`. Since: 2.34
698 #[doc(alias = "G_REGEX_MATCH_NOTEMPTY_ATSTART")]
699 const NOTEMPTY_ATSTART = ffi::G_REGEX_MATCH_NOTEMPTY_ATSTART as _;
700 }
701}
702
703#[doc(hidden)]
704impl IntoGlib for RegexMatchFlags {
705 type GlibType = ffi::GRegexMatchFlags;
706
707 #[inline]
708 fn into_glib(self) -> ffi::GRegexMatchFlags {
709 self.bits()
710 }
711}
712
713#[doc(hidden)]
714impl FromGlib<ffi::GRegexMatchFlags> for RegexMatchFlags {
715 #[inline]
716 unsafe fn from_glib(value: ffi::GRegexMatchFlags) -> Self {
717 Self::from_bits_truncate(value)
718 }
719}
720
721bitflags! {
722 /// Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().
723 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
724 #[doc(alias = "GSpawnFlags")]
725 pub struct SpawnFlags: u32 {
726 /// no flags, default behaviour
727 #[doc(alias = "G_SPAWN_DEFAULT")]
728 const DEFAULT = ffi::G_SPAWN_DEFAULT as _;
729 /// the parent's open file descriptors will
730 /// be inherited by the child; otherwise all descriptors except stdin,
731 /// stdout and stderr will be closed before calling exec() in the child.
732 #[doc(alias = "G_SPAWN_LEAVE_DESCRIPTORS_OPEN")]
733 const LEAVE_DESCRIPTORS_OPEN = ffi::G_SPAWN_LEAVE_DESCRIPTORS_OPEN as _;
734 /// the child will not be automatically reaped;
735 /// you must use g_child_watch_add() yourself (or call waitpid() or handle
736 /// `SIGCHLD` yourself), or the child will become a zombie.
737 #[doc(alias = "G_SPAWN_DO_NOT_REAP_CHILD")]
738 const DO_NOT_REAP_CHILD = ffi::G_SPAWN_DO_NOT_REAP_CHILD as _;
739 /// `argv[0]` need not be an absolute path, it will be
740 /// looked for in the user's `PATH`.
741 #[doc(alias = "G_SPAWN_SEARCH_PATH")]
742 const SEARCH_PATH = ffi::G_SPAWN_SEARCH_PATH as _;
743 /// the child's standard output will be discarded,
744 /// instead of going to the same location as the parent's standard output.
745 #[doc(alias = "G_SPAWN_STDOUT_TO_DEV_NULL")]
746 const STDOUT_TO_DEV_NULL = ffi::G_SPAWN_STDOUT_TO_DEV_NULL as _;
747 /// the child's standard error will be discarded.
748 #[doc(alias = "G_SPAWN_STDERR_TO_DEV_NULL")]
749 const STDERR_TO_DEV_NULL = ffi::G_SPAWN_STDERR_TO_DEV_NULL as _;
750 /// the child will inherit the parent's standard
751 /// input (by default, the child's standard input is attached to `/dev/null`).
752 #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDIN")]
753 const CHILD_INHERITS_STDIN = ffi::G_SPAWN_CHILD_INHERITS_STDIN as _;
754 /// the first element of `argv` is the file to
755 /// execute, while the remaining elements are the actual argument vector
756 /// to pass to the file. Normally g_spawn_async_with_pipes() uses `argv[0]`
757 /// as the file to execute, and passes all of `argv` to the child.
758 #[doc(alias = "G_SPAWN_FILE_AND_ARGV_ZERO")]
759 const FILE_AND_ARGV_ZERO = ffi::G_SPAWN_FILE_AND_ARGV_ZERO as _;
760 /// if `argv[0]` is not an absolute path,
761 /// it will be looked for in the `PATH` from the passed child environment.
762 /// Since: 2.34
763 #[doc(alias = "G_SPAWN_SEARCH_PATH_FROM_ENVP")]
764 const SEARCH_PATH_FROM_ENVP = ffi::G_SPAWN_SEARCH_PATH_FROM_ENVP as _;
765 /// create all pipes with the `O_CLOEXEC` flag set.
766 /// Since: 2.40
767 #[doc(alias = "G_SPAWN_CLOEXEC_PIPES")]
768 const CLOEXEC_PIPES = ffi::G_SPAWN_CLOEXEC_PIPES as _;
769 /// The child will inherit the parent's standard output.
770 #[cfg(feature = "v2_74")]
771 #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
772 #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDOUT")]
773 const CHILD_INHERITS_STDOUT = ffi::G_SPAWN_CHILD_INHERITS_STDOUT as _;
774 /// The child will inherit the parent's standard error.
775 #[cfg(feature = "v2_74")]
776 #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
777 #[doc(alias = "G_SPAWN_CHILD_INHERITS_STDERR")]
778 const CHILD_INHERITS_STDERR = ffi::G_SPAWN_CHILD_INHERITS_STDERR as _;
779 /// The child's standard input is attached to `/dev/null`.
780 #[cfg(feature = "v2_74")]
781 #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))]
782 #[doc(alias = "G_SPAWN_STDIN_FROM_DEV_NULL")]
783 const STDIN_FROM_DEV_NULL = ffi::G_SPAWN_STDIN_FROM_DEV_NULL as _;
784 }
785}
786
787#[doc(hidden)]
788impl IntoGlib for SpawnFlags {
789 type GlibType = ffi::GSpawnFlags;
790
791 #[inline]
792 fn into_glib(self) -> ffi::GSpawnFlags {
793 self.bits()
794 }
795}
796
797#[doc(hidden)]
798impl FromGlib<ffi::GSpawnFlags> for SpawnFlags {
799 #[inline]
800 unsafe fn from_glib(value: ffi::GSpawnFlags) -> Self {
801 Self::from_bits_truncate(value)
802 }
803}
804
805#[cfg(feature = "v2_66")]
806bitflags! {
807 /// Flags that describe a URI.
808 ///
809 /// When parsing a URI, if you need to choose different flags based on
810 /// the type of URI, you can use g_uri_peek_scheme() on the URI string
811 /// to check the scheme first, and use that to decide what flags to
812 /// parse it with.
813 #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
814 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
815 #[doc(alias = "GUriFlags")]
816 pub struct UriFlags: u32 {
817 /// No flags set.
818 #[doc(alias = "G_URI_FLAGS_NONE")]
819 const NONE = ffi::G_URI_FLAGS_NONE as _;
820 /// t use this flag unless you need to.
821 #[doc(alias = "G_URI_FLAGS_PARSE_RELAXED")]
822 const PARSE_RELAXED = ffi::G_URI_FLAGS_PARSE_RELAXED as _;
823 /// The userinfo field may contain a password,
824 /// which will be separated from the username by `:`.
825 #[doc(alias = "G_URI_FLAGS_HAS_PASSWORD")]
826 const HAS_PASSWORD = ffi::G_URI_FLAGS_HAS_PASSWORD as _;
827 /// The userinfo may contain additional
828 /// authentication-related parameters, which will be separated from
829 /// the username and/or password by `;`.
830 #[doc(alias = "G_URI_FLAGS_HAS_AUTH_PARAMS")]
831 const HAS_AUTH_PARAMS = ffi::G_URI_FLAGS_HAS_AUTH_PARAMS as _;
832 /// When parsing a URI, this indicates that `%`-encoded
833 /// characters in the userinfo, path, query, and fragment fields
834 /// should not be decoded. (And likewise the host field if
835 /// [`NON_DNS`][Self::NON_DNS] is also set.) When building a URI, it indicates
836 /// that you have already `%`-encoded the components, and so #GUri
837 /// should not do any encoding itself.
838 #[doc(alias = "G_URI_FLAGS_ENCODED")]
839 const ENCODED = ffi::G_URI_FLAGS_ENCODED as _;
840 /// The host component should not be assumed to be a
841 /// DNS hostname or IP address (for example, for `smb` URIs with NetBIOS
842 /// hostnames).
843 #[doc(alias = "G_URI_FLAGS_NON_DNS")]
844 const NON_DNS = ffi::G_URI_FLAGS_NON_DNS as _;
845 /// Same as [`ENCODED`][Self::ENCODED], for the query
846 /// field only.
847 #[doc(alias = "G_URI_FLAGS_ENCODED_QUERY")]
848 const ENCODED_QUERY = ffi::G_URI_FLAGS_ENCODED_QUERY as _;
849 /// Same as [`ENCODED`][Self::ENCODED], for the path only.
850 #[doc(alias = "G_URI_FLAGS_ENCODED_PATH")]
851 const ENCODED_PATH = ffi::G_URI_FLAGS_ENCODED_PATH as _;
852 /// Same as [`ENCODED`][Self::ENCODED], for the
853 /// fragment only.
854 #[doc(alias = "G_URI_FLAGS_ENCODED_FRAGMENT")]
855 const ENCODED_FRAGMENT = ffi::G_URI_FLAGS_ENCODED_FRAGMENT as _;
856 /// A scheme-based normalization will be applied.
857 /// For example, when parsing an HTTP URI changing omitted path to `/` and
858 /// omitted port to `80`; and when building a URI, changing empty path to `/`
859 /// and default port `80`). This only supports a subset of known schemes. (Since: 2.68)
860 #[doc(alias = "G_URI_FLAGS_SCHEME_NORMALIZE")]
861 const SCHEME_NORMALIZE = ffi::G_URI_FLAGS_SCHEME_NORMALIZE as _;
862 }
863}
864
865#[cfg(feature = "v2_66")]
866#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
867#[doc(hidden)]
868impl IntoGlib for UriFlags {
869 type GlibType = ffi::GUriFlags;
870
871 #[inline]
872 fn into_glib(self) -> ffi::GUriFlags {
873 self.bits()
874 }
875}
876
877#[cfg(feature = "v2_66")]
878#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
879#[doc(hidden)]
880impl FromGlib<ffi::GUriFlags> for UriFlags {
881 #[inline]
882 unsafe fn from_glib(value: ffi::GUriFlags) -> Self {
883 Self::from_bits_truncate(value)
884 }
885}
886
887#[cfg(feature = "v2_66")]
888bitflags! {
889 /// Flags describing what parts of the URI to hide in
890 /// g_uri_to_string_partial(). Note that [`PASSWORD`][Self::PASSWORD] and
891 /// [`AUTH_PARAMS`][Self::AUTH_PARAMS] will only work if the #GUri was parsed with
892 /// the corresponding flags.
893 #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
894 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
895 #[doc(alias = "GUriHideFlags")]
896 pub struct UriHideFlags: u32 {
897 /// No flags set.
898 #[doc(alias = "G_URI_HIDE_NONE")]
899 const NONE = ffi::G_URI_HIDE_NONE as _;
900 /// Hide the userinfo.
901 #[doc(alias = "G_URI_HIDE_USERINFO")]
902 const USERINFO = ffi::G_URI_HIDE_USERINFO as _;
903 /// Hide the password.
904 #[doc(alias = "G_URI_HIDE_PASSWORD")]
905 const PASSWORD = ffi::G_URI_HIDE_PASSWORD as _;
906 /// Hide the auth_params.
907 #[doc(alias = "G_URI_HIDE_AUTH_PARAMS")]
908 const AUTH_PARAMS = ffi::G_URI_HIDE_AUTH_PARAMS as _;
909 /// Hide the query.
910 #[doc(alias = "G_URI_HIDE_QUERY")]
911 const QUERY = ffi::G_URI_HIDE_QUERY as _;
912 /// Hide the fragment.
913 #[doc(alias = "G_URI_HIDE_FRAGMENT")]
914 const FRAGMENT = ffi::G_URI_HIDE_FRAGMENT as _;
915 }
916}
917
918#[cfg(feature = "v2_66")]
919#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
920#[doc(hidden)]
921impl IntoGlib for UriHideFlags {
922 type GlibType = ffi::GUriHideFlags;
923
924 #[inline]
925 fn into_glib(self) -> ffi::GUriHideFlags {
926 self.bits()
927 }
928}
929
930#[cfg(feature = "v2_66")]
931#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
932#[doc(hidden)]
933impl FromGlib<ffi::GUriHideFlags> for UriHideFlags {
934 #[inline]
935 unsafe fn from_glib(value: ffi::GUriHideFlags) -> Self {
936 Self::from_bits_truncate(value)
937 }
938}
939
940#[cfg(feature = "v2_66")]
941bitflags! {
942 /// Flags modifying the way parameters are handled by g_uri_parse_params() and
943 /// #GUriParamsIter.
944 #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
945 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
946 #[doc(alias = "GUriParamsFlags")]
947 pub struct UriParamsFlags: u32 {
948 /// No flags set.
949 #[doc(alias = "G_URI_PARAMS_NONE")]
950 const NONE = ffi::G_URI_PARAMS_NONE as _;
951 /// Parameter names are case insensitive.
952 #[doc(alias = "G_URI_PARAMS_CASE_INSENSITIVE")]
953 const CASE_INSENSITIVE = ffi::G_URI_PARAMS_CASE_INSENSITIVE as _;
954 /// Replace `+` with space character. Only useful for
955 /// URLs on the web, using the `https` or `http` schemas.
956 #[doc(alias = "G_URI_PARAMS_WWW_FORM")]
957 const WWW_FORM = ffi::G_URI_PARAMS_WWW_FORM as _;
958 /// See [`UriFlags::PARSE_RELAXED`][crate::UriFlags::PARSE_RELAXED].
959 #[doc(alias = "G_URI_PARAMS_PARSE_RELAXED")]
960 const PARSE_RELAXED = ffi::G_URI_PARAMS_PARSE_RELAXED as _;
961 }
962}
963
964#[cfg(feature = "v2_66")]
965#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
966#[doc(hidden)]
967impl IntoGlib for UriParamsFlags {
968 type GlibType = ffi::GUriParamsFlags;
969
970 #[inline]
971 fn into_glib(self) -> ffi::GUriParamsFlags {
972 self.bits()
973 }
974}
975
976#[cfg(feature = "v2_66")]
977#[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))]
978#[doc(hidden)]
979impl FromGlib<ffi::GUriParamsFlags> for UriParamsFlags {
980 #[inline]
981 unsafe fn from_glib(value: ffi::GUriParamsFlags) -> Self {
982 Self::from_bits_truncate(value)
983 }
984}