[−][src]Struct rec::Ch
Represents a character that can match one or more characters.
Methods
impl<'_> Ch<'_>
[src]
pub const fn any() -> Ch<'static>
[src]
Creates a Ch
that matches any character other than a newline.
Examples
use rec::{Ch, Element}; assert_eq!(Ch::any().into_rec(), String::from(".").into_rec());
pub const fn alpha() -> Ch<'static>
[src]
Creates a Ch
that matches any alphabetic character.
Examples
use rec::{Ch, Element}; assert_eq!(Ch::alpha().into_rec(), String::from("[[:alpha:]]").into_rec());
pub const fn alphanum() -> Ch<'static>
[src]
Creates a Ch
that matches any alphabetic or numerical digit character.
Examples
use rec::{Ch, Element}; assert_eq!(Ch::alphanum().into_rec(), String::from("[[:alnum:]]").into_rec());
pub const fn digit() -> Ch<'static>
[src]
Creates a Ch
that matches any numerical digit character.
Examples
use rec::{Ch, Element}; assert_eq!(Ch::digit().into_rec(), String::from(r"\d").into_rec());
pub const fn whitespace() -> Ch<'static>
[src]
Creates a Ch
that matches any whitespace character.
Examples
use rec::{Ch, Element}; assert_eq!(Ch::whitespace().into_rec(), String::from(r"\s").into_rec());
pub const fn start() -> Ch<'static>
[src]
Creates a Ch
that matches with the start of the text.
Examples
use rec::{Ch, Element}; assert_eq!(Ch::start().into_rec(), String::from("^").into_rec());
pub const fn end() -> Ch<'static>
[src]
Creates a Ch
that matches with the end of the text.
Examples
use rec::{Ch, Element}; assert_eq!(Ch::end().into_rec(), String::from("$").into_rec());
pub fn sign() -> Ch<'static>
[src]
Creates a Ch
that matches with the sign character of a number.
Examples
use rec::{Ch, Element}; assert_eq!(Ch::sign().into_rec(), String::from(r"[+\-]").into_rec());
pub fn union(chars: &str) -> Ch
[src]
Creates a Ch
that matches with any of the given characters.
Examples
use rec::{Ch, Element}; assert_eq!(Ch::union("abc").into_rec(), String::from("[abc]").into_rec());
-
is not interpreted as range
use rec::{Ch, Element}; assert_eq!(Ch::union("a-c").into_rec(), String::from(r"[a\-c]").into_rec());
Trait Implementations
impl<'_> Element for Ch<'_>
[src]
fn into_rec(self) -> Rec
[src]
fn group(self) -> Rec where
Self: Sized,
[src]
Self: Sized,
Converts self
into a Rec
that is grouped.
impl<'a> Debug for Ch<'a>
[src]
impl<Rhs: Element, '_> Add<Rhs> for Ch<'_>
[src]
type Output = Rec
The resulting type after applying the +
operator.
fn add(self, rhs: Rhs) -> Rec
[src]
impl<'a> Not for Ch<'a>
[src]
type Output = Ch<'a>
The resulting type after applying the !
operator.
fn not(self) -> Self::Output
[src]
impl<Rhs: Element, '_> BitOr<Rhs> for Ch<'_>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for 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,