pub struct RegexMatchFlags(/* private fields */);
Expand description
Flags specifying match-time options.
Implementations§
Source§impl RegexMatchFlags
impl RegexMatchFlags
Sourcepub const ANCHORED: Self = _
pub const ANCHORED: Self = _
The pattern is forced to be “anchored”, that is, it is constrained to match only at the first matching point in the string that is being searched. This effect can also be achieved by appropriate constructs in the pattern itself such as the “^” metacharacter.
Sourcepub const NOTBOL: Self = _
pub const NOTBOL: Self = _
Specifies that first character of the string is
not the beginning of a line, so the circumflex metacharacter should
not match before it. Setting this without RegexCompileFlags::MULTILINE
(at
compile time) causes circumflex never to match. This option affects
only the behaviour of the circumflex metacharacter, it does not
affect “\A”.
Sourcepub const NOTEOL: Self = _
pub const NOTEOL: Self = _
Specifies that the end of the subject string is
not the end of a line, so the dollar metacharacter should not match
it nor (except in multiline mode) a newline immediately before it.
Setting this without RegexCompileFlags::MULTILINE
(at compile time) causes
dollar never to match. This option affects only the behaviour of
the dollar metacharacter, it does not affect “\Z” or “\z”.
Sourcepub const NOTEMPTY: Self = _
pub const NOTEMPTY: Self = _
An empty string is not considered to be a valid match if this option is set. If there are alternatives in the pattern, they are tried. If all the alternatives match the empty string, the entire match fails. For example, if the pattern “a?b?” is applied to a string not beginning with “a” or “b”, it matches the empty string at the start of the string. With this flag set, this match is not valid, so GRegex searches further into the string for occurrences of “a” or “b”.
Sourcepub const PARTIAL: Self = _
pub const PARTIAL: Self = _
Turns on the partial matching feature, for more documentation on partial matching see g_match_info_is_partial_match().
Sourcepub const NEWLINE_CR: Self = _
pub const NEWLINE_CR: Self = _
Overrides the newline definition set when creating a new #GRegex, setting the ‘\r’ character as line terminator.
Sourcepub const NEWLINE_LF: Self = _
pub const NEWLINE_LF: Self = _
Overrides the newline definition set when creating a new #GRegex, setting the ‘\n’ character as line terminator.
Sourcepub const NEWLINE_CRLF: Self = _
pub const NEWLINE_CRLF: Self = _
Overrides the newline definition set when creating a new #GRegex, setting the ‘\r\n’ characters sequence as line terminator.
Sourcepub const NEWLINE_ANY: Self = _
pub const NEWLINE_ANY: Self = _
Overrides the newline definition set when creating a new #GRegex, any Unicode newline sequence is recognised as a newline. These are ‘\r’, ‘\n’ and ‘\rn’, and the single characters U+000B LINE TABULATION, U+000C FORM FEED (FF), U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR.
Sourcepub const NEWLINE_ANYCRLF: Self = _
pub const NEWLINE_ANYCRLF: Self = _
Overrides the newline definition set when creating a new #GRegex; any ‘\r’, ‘\n’, or ‘\r\n’ character sequence is recognized as a newline. Since: 2.34
Sourcepub const BSR_ANYCRLF: Self = _
pub const BSR_ANYCRLF: Self = _
Overrides the newline definition for “\R” set when creating a new #GRegex; only ‘\r’, ‘\n’, or ‘\r\n’ character sequences are recognized as a newline by “\R”. Since: 2.34
Sourcepub const BSR_ANY: Self = _
pub const BSR_ANY: Self = _
Overrides the newline definition for “\R” set when creating a new #GRegex; any Unicode newline character or character sequence are recognized as a newline by “\R”. These are ‘\r’, ‘\n’ and ‘\rn’, and the single characters U+000B LINE TABULATION, U+000C FORM FEED (FF), U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR. Since: 2.34
Sourcepub const PARTIAL_SOFT: Self = _
pub const PARTIAL_SOFT: Self = _
An alias for PARTIAL
. Since: 2.34
Sourcepub const PARTIAL_HARD: Self = _
pub const PARTIAL_HARD: Self = _
Turns on the partial matching feature. In contrast to
to PARTIAL_SOFT
, this stops matching as soon as a partial match
is found, without continuing to search for a possible complete match. See
g_match_info_is_partial_match() for more information. Since: 2.34
Sourcepub const NOTEMPTY_ATSTART: Self = _
pub const NOTEMPTY_ATSTART: Self = _
Like NOTEMPTY
, but only applied to
the start of the matched string. For anchored
patterns this can only happen for pattern containing “\K”. Since: 2.34
Source§impl RegexMatchFlags
impl RegexMatchFlags
Sourcepub const fn bits(&self) -> u32
pub const fn bits(&self) -> u32
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u32) -> Option<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u32) -> Self
pub const fn from_bits_truncate(bits: u32) -> Self
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u32) -> Self
pub const fn from_bits_retain(bits: u32) -> Self
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
Sourcepub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!
) of the bits in a flags value, truncating the result.
Source§impl RegexMatchFlags
impl RegexMatchFlags
Sourcepub const fn iter(&self) -> Iter<RegexMatchFlags>
pub const fn iter(&self) -> Iter<RegexMatchFlags>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<RegexMatchFlags>
pub const fn iter_names(&self) -> IterNames<RegexMatchFlags>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
Source§impl Binary for RegexMatchFlags
impl Binary for RegexMatchFlags
Source§impl BitAnd for RegexMatchFlags
impl BitAnd for RegexMatchFlags
Source§impl BitAndAssign for RegexMatchFlags
impl BitAndAssign for RegexMatchFlags
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&
) of the bits in two flags values.
Source§impl BitOr for RegexMatchFlags
impl BitOr for RegexMatchFlags
Source§fn bitor(self, other: RegexMatchFlags) -> Self
fn bitor(self, other: RegexMatchFlags) -> Self
The bitwise or (|
) of the bits in two flags values.
Source§type Output = RegexMatchFlags
type Output = RegexMatchFlags
|
operator.Source§impl BitOrAssign for RegexMatchFlags
impl BitOrAssign for RegexMatchFlags
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
Source§impl BitXor for RegexMatchFlags
impl BitXor for RegexMatchFlags
Source§impl BitXorAssign for RegexMatchFlags
impl BitXorAssign for RegexMatchFlags
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Source§impl Clone for RegexMatchFlags
impl Clone for RegexMatchFlags
Source§fn clone(&self) -> RegexMatchFlags
fn clone(&self) -> RegexMatchFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RegexMatchFlags
impl Debug for RegexMatchFlags
Source§impl Extend<RegexMatchFlags> for RegexMatchFlags
impl Extend<RegexMatchFlags> for RegexMatchFlags
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
The bitwise or (|
) of the bits in each flags value.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl Flags for RegexMatchFlags
impl Flags for RegexMatchFlags
Source§const FLAGS: &'static [Flag<RegexMatchFlags>] = _
const FLAGS: &'static [Flag<RegexMatchFlags>] = _
Source§fn from_bits_retain(bits: u32) -> RegexMatchFlags
fn from_bits_retain(bits: u32) -> RegexMatchFlags
§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read more§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert
] when value
is true
or [Flags::remove
] when value
is false
.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read more§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.Source§impl FromIterator<RegexMatchFlags> for RegexMatchFlags
impl FromIterator<RegexMatchFlags> for RegexMatchFlags
Source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|
) of the bits in each flags value.
Source§impl Hash for RegexMatchFlags
impl Hash for RegexMatchFlags
Source§impl IntoIterator for RegexMatchFlags
impl IntoIterator for RegexMatchFlags
Source§impl LowerHex for RegexMatchFlags
impl LowerHex for RegexMatchFlags
Source§impl Not for RegexMatchFlags
impl Not for RegexMatchFlags
Source§impl Octal for RegexMatchFlags
impl Octal for RegexMatchFlags
Source§impl PartialEq for RegexMatchFlags
impl PartialEq for RegexMatchFlags
Source§impl PublicFlags for RegexMatchFlags
impl PublicFlags for RegexMatchFlags
Source§impl Sub for RegexMatchFlags
impl Sub for RegexMatchFlags
Source§fn sub(self, other: Self) -> Self
fn sub(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Source§type Output = RegexMatchFlags
type Output = RegexMatchFlags
-
operator.Source§impl SubAssign for RegexMatchFlags
impl SubAssign for RegexMatchFlags
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Source§impl UpperHex for RegexMatchFlags
impl UpperHex for RegexMatchFlags
impl Copy for RegexMatchFlags
impl Eq for RegexMatchFlags
impl StructuralPartialEq for RegexMatchFlags
Auto Trait Implementations§
impl Freeze for RegexMatchFlags
impl RefUnwindSafe for RegexMatchFlags
impl Send for RegexMatchFlags
impl Sync for RegexMatchFlags
impl Unpin for RegexMatchFlags
impl UnwindSafe for RegexMatchFlags
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)