pub struct Options { /* private fields */ }
Expand description
Configuration options for Ruby Regexps.
Options can be supplied either as an Integer
object to Regexp::new
or
inline in Regexp literals like /artichoke/i
.
Implementations
sourceimpl Options
impl Options
sourcepub const fn with_ignore_case() -> Options
pub const fn with_ignore_case() -> Options
An options instance that has only case insensitive mode enabled.
sourcepub fn try_from_int(options: i64) -> Option<Options>
pub fn try_from_int(options: i64) -> Option<Options>
Try to parse an Options
from a full-width i64
.
If options
cannot be converted losslessly to a u8
, this function
returns None
. See From<u8>
.
For a conversion from i64
that truncates the given options
to u8
,
see From<i64>
.
sourcepub const fn flags(self) -> Flags
pub const fn flags(self) -> Flags
Convert an Options
to its bit flag representation.
Alias for the corresponding Into<Flags>
implementation.
sourcepub const fn into_bits(self) -> u8
pub const fn into_bits(self) -> u8
Convert an Options
to its bit representation.
Alias for the corresponding Into<u8>
implementation.
sourcepub const fn multiline(self) -> RegexpOption
pub const fn multiline(self) -> RegexpOption
Whether these Options
are configured for multiline mode.
sourcepub const fn ignore_case(self) -> RegexpOption
pub const fn ignore_case(self) -> RegexpOption
Whether these Options
are configured for case-insensitive mode.
sourcepub const fn extended(self) -> RegexpOption
pub const fn extended(self) -> RegexpOption
Whether these Options
are configured for extended mode with
insignificant whitespace.
sourcepub const fn is_literal(self) -> bool
pub const fn is_literal(self) -> bool
Whether the Regexp was parsed as a literal, e.g. '/artichoke/i
.
This enables Ruby parsers to inject whether a Regexp is a literal to the core library. Literal Regexps have some special behavior regarding capturing groups and report parse failures differently.
sourcepub const fn as_display_modifier(self) -> &'static str
pub const fn as_display_modifier(self) -> &'static str
Serialize the option flags to a string suitable for a Regexp
display
or debug implementation.
See also Regexp#inspect
.
sourcepub const fn as_inline_modifier(self) -> &'static str
pub const fn as_inline_modifier(self) -> &'static str
Serialize the option flags to a string suitable for including in a raw
pattern for configuring an underlying Regexp
.
Trait Implementations
sourceimpl ConvertMut<Value, Options> for Artichoke
impl ConvertMut<Value, Options> for Artichoke
sourcefn convert_mut(&mut self, value: Value) -> Options
fn convert_mut(&mut self, value: Value) -> Options
Performs the infallible conversion.
sourceimpl Ord for Options
impl Ord for Options
sourceimpl PartialOrd<Options> for Options
impl PartialOrd<Options> for Options
sourcefn partial_cmp(&self, other: &Options) -> Option<Ordering>
fn partial_cmp(&self, other: &Options) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Options
impl Eq for Options
impl StructuralEq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more