[][src]Struct rec::Ch

pub struct Ch<'a> { /* fields omitted */ }

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 group(self) -> Rec where
    Self: Sized
[src]

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.

impl<'a> Not for Ch<'a>[src]

type Output = Ch<'a>

The resulting type after applying the ! operator.

impl<Rhs: Element, '_> BitOr<Rhs> for Ch<'_>[src]

type Output = Rec

The resulting type after applying the | operator.

Auto Trait Implementations

impl<'a> Send for Ch<'a>

impl<'a> Sync for Ch<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]