pub enum RegularExpression {
Character(RangeSet<Char>),
Repetition(Box<RegularExpression>, u32, Option<u32>),
Concat(VecDeque<RegularExpression>),
Alternation(Vec<RegularExpression>),
}Expand description
Represent a regular expression.
Variants§
Character(RangeSet<Char>)
Repetition(Box<RegularExpression>, u32, Option<u32>)
Concat(VecDeque<RegularExpression>)
Alternation(Vec<RegularExpression>)
Implementations§
source§impl RegularExpression
impl RegularExpression
pub fn get_common_affixes( &self, other: &RegularExpression, ) -> (Option<RegularExpression>, (RegularExpression, RegularExpression), Option<RegularExpression>)
pub fn get_common_affix( &self, other: &RegularExpression, is_prefix: bool, ) -> (Option<RegularExpression>, (RegularExpression, RegularExpression))
source§impl RegularExpression
impl RegularExpression
pub fn get_number_of_states_in_nfa(&self) -> usize
source§impl RegularExpression
impl RegularExpression
pub fn get_length(&self) -> (Option<u32>, Option<u32>)
pub fn get_cardinality(&self) -> Cardinality<u32>
source§impl RegularExpression
impl RegularExpression
pub fn concat( &self, other: &RegularExpression, append_back: bool, ) -> RegularExpression
source§impl RegularExpression
impl RegularExpression
pub fn union(&self, other: &RegularExpression) -> RegularExpression
source§impl RegularExpression
impl RegularExpression
pub fn is_empty(&self) -> bool
pub fn is_empty_string(&self) -> bool
pub fn is_total(&self) -> bool
pub fn to_automaton(&self) -> Result<FastAutomaton, EngineError>
Trait Implementations§
source§impl Clone for RegularExpression
impl Clone for RegularExpression
source§fn clone(&self) -> RegularExpression
fn clone(&self) -> RegularExpression
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for RegularExpression
impl Debug for RegularExpression
source§impl<'de> Deserialize<'de> for RegularExpression
impl<'de> Deserialize<'de> for RegularExpression
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for RegularExpression
impl Display for RegularExpression
source§impl Hash for RegularExpression
impl Hash for RegularExpression
source§impl Ord for RegularExpression
impl Ord for RegularExpression
source§fn cmp(&self, other: &RegularExpression) -> Ordering
fn cmp(&self, other: &RegularExpression) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for RegularExpression
impl PartialEq for RegularExpression
source§impl PartialOrd for RegularExpression
impl PartialOrd for RegularExpression
source§impl Serialize for RegularExpression
impl Serialize for RegularExpression
impl Eq for RegularExpression
impl StructuralPartialEq for RegularExpression
Auto Trait Implementations§
impl Freeze for RegularExpression
impl RefUnwindSafe for RegularExpression
impl Send for RegularExpression
impl Sync for RegularExpression
impl Unpin for RegularExpression
impl UnwindSafe for RegularExpression
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.