Enum safe_regex_compiler::parser::NonFinalNode
source · [−]pub enum NonFinalNode {
Show 15 variants
Escape,
HexEscape0,
HexEscape1(u8),
OpenClass0,
OpenClassNeg,
OpenClass(bool, Vec<ClassItem>),
OpenByteRange(u8),
ByteRange(u8, u8),
OpenGroup,
OpenExtendedGroup,
OpenNonCapturingGroup,
OpenAlt(Vec<FinalNode>),
RepeatMin(String),
RepeatMax(String, String),
RepeatToken(String, usize, Option<usize>),
}
Expand description
AST nodes used internally during parsing.
Variants
Escape
HexEscape0
HexEscape1(u8)
OpenClass0
OpenClassNeg
OpenClass(bool, Vec<ClassItem>)
OpenByteRange(u8)
ByteRange(u8, u8)
OpenGroup
OpenExtendedGroup
OpenNonCapturingGroup
OpenAlt(Vec<FinalNode>)
RepeatMin(String)
RepeatMax(String, String)
RepeatToken(String, usize, Option<usize>)
Implementations
sourceimpl NonFinalNode
impl NonFinalNode
sourcepub fn reason(&self) -> String
pub fn reason(&self) -> String
Parsing can fail when a NonFinalNode
is not converted into a
FinalNode
. This function returns an explanation to show to the user.
sourcepub fn unwrap_open_class(self) -> (bool, Vec<ClassItem>)
pub fn unwrap_open_class(self) -> (bool, Vec<ClassItem>)
Returns the contents of this NonFinalNode::OpenClass(..)
.
Panics if this is a different enum variant.
sourcepub fn unwrap_open_alt(self) -> Vec<FinalNode>
pub fn unwrap_open_alt(self) -> Vec<FinalNode>
Returns the contents of this NonFinalNode::OpenAlt(..)
.
Panics if this is a different enum variant.
sourcepub fn unwrap_repeat_min(self) -> String
pub fn unwrap_repeat_min(self) -> String
Returns the contents of this NonFinalNode::RepeatMin(..)
.
Panics if this is a different enum variant.
Trait Implementations
sourceimpl Clone for NonFinalNode
impl Clone for NonFinalNode
sourcefn clone(&self) -> NonFinalNode
fn clone(&self) -> NonFinalNode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for NonFinalNode
impl Debug for NonFinalNode
sourceimpl PartialEq<NonFinalNode> for NonFinalNode
impl PartialEq<NonFinalNode> for NonFinalNode
sourcefn eq(&self, other: &NonFinalNode) -> bool
fn eq(&self, other: &NonFinalNode) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &NonFinalNode) -> bool
fn ne(&self, other: &NonFinalNode) -> bool
This method tests for !=
.
sourceimpl PartialOrd<NonFinalNode> for NonFinalNode
impl PartialOrd<NonFinalNode> for NonFinalNode
sourcefn partial_cmp(&self, other: &NonFinalNode) -> Option<Ordering>
fn partial_cmp(&self, other: &NonFinalNode) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl StructuralPartialEq for NonFinalNode
Auto Trait Implementations
impl RefUnwindSafe for NonFinalNode
impl Send for NonFinalNode
impl Sync for NonFinalNode
impl Unpin for NonFinalNode
impl UnwindSafe for NonFinalNode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more