[][src]Struct ieql::common::pattern::Pattern

pub struct Pattern {
    pub content: String,
    pub kind: PatternKind,
}

The Pattern struct represents an uncompiled pattern. Patterns are essentially RegEx searches; given an expression, they theoretically will match text. Note that in order for patterns to actually match text, they must first be compiled. (See CompiledPattern).

Fields

content: String

The pattern to match; either plaintext or a regular expression, depending on the value of kind. Note that RegEx lookbacks are not supported; all RegEx expressions must search in linear time. See the Rust regex documentation for more information.

kind: PatternKind

Represents the type of pattern; i.e. RegEx or Raw.

Methods

impl Pattern[src]

pub fn get_as_safe_regex(&self) -> String[src]

Given any pattern, this function returns its expression as safe-to-compile RegEx. For Raw patterns, the expression is escaped; for RegEx patterns, it is cloned. Note that this function does not validate whether the RegEx is valid; it simply prepares it for compilation.

This is a utility function, and is currently not used during compilation.

Trait Implementations

impl Validatable for Pattern[src]

fn validate(&self) -> Option<Vec<Issue>>[src]

This function determines whether the Pattern is valid. It performs a compilation check for itself and for its RegEx.

Returns None if there is no issue; otherwise, Some(Vec<Issue>).

impl CompilableTo<CompiledPattern> for Pattern[src]

fn compile(&self) -> Result<CompiledPattern, Issue>[src]

This function compiles the Pattern into a CompiledPattern by escaping the RegEx expression as necessary and then compiling it.

impl Clone for Pattern[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Pattern> for Pattern[src]

impl Debug for Pattern[src]

impl Serialize for Pattern[src]

impl<'de> Deserialize<'de> for Pattern[src]

Auto Trait Implementations

impl Send for Pattern

impl Sync for Pattern

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]