[−][src]Struct ieql::common::pattern::Pattern
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(&self) -> 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]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Pattern
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,