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