[−][src]Enum rec::Class
An enumeration of predefined single character matches.
Variants
Alpha
Matches any alphabetic character.
Examples
use rec::{Class, prelude::*}; assert_eq!(Class::Alpha, Rec::from("[[:alpha:]]"));
AlphaNum
Matches any alphabetic or numerical digit character.
Examples
use rec::{Class, prelude::*}; assert_eq!(Class::AlphaNum, Rec::from("[[:alnum:]]"));
Digit
Matches any numerical digit character.
Examples
use rec::{Class, prelude::*}; assert_eq!(Class::Digit, Rec::from(r"\d"));
Whitespace
Matches any whitespace character.
Examples
use rec::{Class, prelude::*}; assert_eq!(Class::Whitespace, Rec::from(r"\s"));
Any
Matches any character other than a newline.
Examples
use rec::{Class, prelude::*}; assert_eq!(Class::Any, Rec::from("."));
Start
Matches with the start of the text.
Examples
use rec::{Class, prelude::*}; assert_eq!(Class::Start, Rec::from("^"));
End
Matches with the end of the text.
Examples
use rec::{Class, prelude::*}; assert_eq!(Class::End, Rec::from("$"));
Sign
Matches with the sign character of a number.
Examples
use rec::{Class, prelude::*}; assert_eq!(Class::Sign, Rec::from(r"[+\-]"));
NonZeroDigit
Matches with any digit that is not 0
.
Examples
use rec::{Class, prelude::*}; assert_eq!(Class::NonZeroDigit, Rec::from(r"[1-9]"));
HexDigit
Matches with any hexidecimal digit.
Examples
use rec::{Class, prelude::*}; assert_eq!(Class::HexDigit, Rec::from("[[:xdigit:]]"));
Trait Implementations
impl Atom for Class
[src]
impl Element for Class
[src]
fn to_regex(&self) -> String
[src]
fn is_atom(&self) -> bool
[src]
fn alternate(&self, other: &dyn Element) -> Rec
[src]
fn concatenate(&self, other: &dyn Element) -> Rec
[src]
Creates a Rec
consisting of the concatenation of self
and other
.
fn is_equal(&self, other: &dyn Element) -> bool
[src]
Returns if the regular expression of self
is equal to that of other
.
fn isolate(&self) -> String
[src]
Returns the regular expression of self
such that it can be concatenated. Read more
fn group(&self) -> String
[src]
impl<T: Element> PartialEq<T> for Class
[src]
fn eq(&self, other: &T) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Copy for Class
[src]
impl Clone for Class
[src]
fn clone(&self) -> Class
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<Rhs: Element> Add<Rhs> for Class
[src]
type Output = Rec
The resulting type after applying the +
operator.
fn add(self, rhs: Rhs) -> Self::Output
[src]
impl Add<Class> for char
[src]
type Output = Rec
The resulting type after applying the +
operator.
fn add(self, rhs: Class) -> Self::Output
[src]
use rec::{Class, prelude::*}; assert_eq!('a' + Class::Digit, Rec::from(r"a\d"));
impl<'_> Add<Class> for &'_ str
[src]
type Output = Rec
The resulting type after applying the +
operator.
fn add(self, rhs: Class) -> Self::Output
[src]
use rec::{Class, prelude::*}; assert_eq!("hello" + Class::Digit, Rec::from(r"hello\d"));
impl BitOr<char> for Class
[src]
type Output = Ch
The resulting type after applying the |
operator.
fn bitor(self, rhs: char) -> Self::Output
[src]
use rec::{Class, prelude::*}; assert_eq!(Class::Alpha | '0', Rec::from("[[:alpha:]0]"));
impl BitOr<Class> for Class
[src]
type Output = Ch
The resulting type after applying the |
operator.
fn bitor(self, rhs: Self) -> Self::Output
[src]
use rec::{Class, prelude::*}; assert_eq!(Class::Alpha | Class::Whitespace, Rec::from(r"[[:alpha:]\s]"));
use rec::{Class, prelude::*}; assert_eq!(Class::Alpha | Class::Digit, Rec::from("[[:alnum:]]"));
impl<'_> BitOr<&'_ str> for Class
[src]
type Output = Rec
The resulting type after applying the |
operator.
fn bitor(self, rhs: &str) -> Self::Output
[src]
use rec::{Class, prelude::*}; assert_eq!(Class::Alpha | "12", Rec::from("[[:alpha:]]|12"));
impl BitOr<Rec> for Class
[src]
type Output = Rec
The resulting type after applying the |
operator.
fn bitor(self, rhs: Rec) -> Self::Output
[src]
impl Debug for Class
[src]
Auto Trait Implementations
impl Sync for Class
impl Send for Class
impl Unpin for Class
impl RefUnwindSafe for Class
impl UnwindSafe for Class
Blanket Implementations
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> From<T> for T
[src]
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,