pub enum Regex<B: Builder> {
    EmptySet,
    EmptyString,
    Symbol(B::Symbol),
    Concat(Box<Self>, Box<Self>),
    Closure(Box<Self>),
    Or(Box<Self>, Box<Self>),
    And(Box<Self>, Box<Self>),
    Complement(Box<Self>),
}
Expand description

Data type describing regular expressions over values of type S.

Variants§

§

EmptySet

§

EmptyString

§

Symbol(B::Symbol)

§

Concat(Box<Self>, Box<Self>)

§

Closure(Box<Self>)

§

Or(Box<Self>, Box<Self>)

§

And(Box<Self>, Box<Self>)

§

Complement(Box<Self>)

Implementations§

source§

impl<B: Builder> Regex<B>

source

pub fn derive(&self, symbol: &B::Symbol) -> Regex<B>
where B: Clone, B::Symbol: Clone + Eq,

Returns the derivative of this regular expression w.r.t. to the given symbol.

source

pub fn derive_iter<I>(&self, symbols: impl IntoIterator<Item = I>) -> Regex<B>
where B: Clone, B::Symbol: Clone + Eq, I: Borrow<B::Symbol>,

Returns the derivative of this regular expression w.r.t. the given symbols.

source

pub fn is_match<I>(&self, symbols: impl IntoIterator<Item = I>) -> bool
where B: Clone, B::Symbol: Clone + Eq, I: Borrow<B::Symbol>,

Returns whether the string of symbols is in the language of this regular expression.

source§

impl<B: Builder> Regex<B>

source

pub fn is_nullable(&self) -> bool

Returns whether the empty string is in the language of this regular expression.

source

pub fn nullable(&self) -> Regex<B>

Returns empty string if this regular expression is nullable, otherwise returns empty set.

source§

impl<B: Builder> Regex<B>
where B::Symbol: Clone,

source

pub fn rebuild<X: Builder<Symbol = B::Symbol>>(&self) -> Regex<X>

Rebuild this regular expression using a different builder over the same symbol type.

Trait Implementations§

source§

impl<B: Builder> Add for Regex<B>

§

type Output = Regex<B>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl<B: Builder> BitAnd for Regex<B>

§

type Output = Regex<B>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
source§

impl<B: Builder> BitOr for Regex<B>

§

type Output = Regex<B>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl<B: Clone + Builder> Clone for Regex<B>
where B::Symbol: Clone,

source§

fn clone(&self) -> Regex<B>

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<B: Debug + Builder> Debug for Regex<B>
where B::Symbol: Debug,

source§

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

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

impl<B: Hash + Builder> Hash for Regex<B>
where B::Symbol: Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<B: Builder> IntoClosure<B> for Regex<B>

source§

fn c(self) -> Regex<B>

source§

impl<B: Builder> Not for Regex<B>

§

type Output = Regex<B>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl<B: PartialEq + Builder> PartialEq for Regex<B>
where B::Symbol: PartialEq,

source§

fn eq(&self, other: &Regex<B>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<B: Eq + Builder> Eq for Regex<B>
where B::Symbol: Eq,

source§

impl<B: Builder> StructuralEq for Regex<B>

source§

impl<B: Builder> StructuralPartialEq for Regex<B>

Auto Trait Implementations§

§

impl<B> RefUnwindSafe for Regex<B>
where <B as Builder>::Symbol: RefUnwindSafe,

§

impl<B> Send for Regex<B>
where <B as Builder>::Symbol: Send,

§

impl<B> Sync for Regex<B>
where <B as Builder>::Symbol: Sync,

§

impl<B> Unpin for Regex<B>
where <B as Builder>::Symbol: Unpin,

§

impl<B> UnwindSafe for Regex<B>
where <B as Builder>::Symbol: UnwindSafe,

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, 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.