Struct regress::Flags

source ·
pub struct Flags {
    pub icase: bool,
    pub multiline: bool,
    pub dot_all: bool,
    pub no_opt: bool,
    pub unicode: bool,
    pub unicode_sets: bool,
}
Expand description

Flags used to control regex parsing. The default flags are case-sensitive, not-multiline, and optimizing.

Fields§

§icase: bool

If set, make the regex case-insensitive. Equivalent to the ‘i’ flag in JavaScript.

§multiline: bool

If set, ^ and $ match at line separators, not just the input boundaries. Equivalent to the ‘m’ flag in JavaScript.

§dot_all: bool

If set, . matches at line separators as well as any other character. Equivalent to the ‘m’ flag in JavaScript.

§no_opt: bool

If set, disable regex IR passes.

§unicode: bool

If set, the regex is interpreted as a Unicode regex. Equivalent to the ‘u’ flag in JavaScript.

§unicode_sets: bool

If set, the regex is interpreted as a UnicodeSets regex. Equivalent to the ‘v’ flag in JavaScript.

Implementations§

source§

impl Flags

source

pub fn new<T: Iterator<Item = u32>>(chars: T) -> Self

Construct a Flags from a Unicode codepoints iterator, using JavaScript field names. ‘i’ means to ignore case, ‘m’ means multiline, ‘u’ means unicode. Note the ‘g’ flag implies a stateful regex and is not supported. Other flags are not implemented and are ignored.

Trait Implementations§

source§

impl Clone for Flags

source§

fn clone(&self) -> Flags

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Flags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Flags

source§

fn default() -> Flags

Returns the “default value” for a type. Read more
source§

impl Display for Flags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&str> for Flags

source§

fn from(s: &str) -> Self

Construct a Flags from a string, using JavaScript field names.

See also: Flags::new.

source§

impl Copy for Flags

Auto Trait Implementations§

§

impl Freeze for Flags

§

impl RefUnwindSafe for Flags

§

impl Send for Flags

§

impl Sync for Flags

§

impl Unpin for Flags

§

impl UnwindSafe for Flags

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.