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