Enum regex_syntax::unicode::ClassQuery

source ·
pub enum ClassQuery<'a> {
    OneLetter(char),
    Binary(&'a str),
    ByValue {
        property_name: &'a str,
        property_value: &'a str,
    },
}
Expand description

A query for finding a character class defined by Unicode. This supports either use of a property name directly, or lookup by property value. The former generally refers to Binary properties (see UTS#44, Table 8), but as a special exception (see UTS#18, Section 1.2) both general categories (an enumeration) and scripts (a catalog) are supported as if each of their possible values were a binary property.

In all circumstances, property names and values are normalized and canonicalized. That is, GC == gc == GeneralCategory == general_category.

The lifetime 'a refers to the shorter of the lifetimes of property name and property value.

Variants§

§

OneLetter(char)

Return a class corresponding to a Unicode binary property, named by a single letter.

§

Binary(&'a str)

Return a class corresponding to a Unicode binary property.

Note that, by special exception (see UTS#18, Section 1.2), both general category values and script values are permitted here as if they were a binary property.

§

ByValue

Return a class corresponding to all codepoints whose property (identified by property_name) corresponds to the given value (identified by property_value).

Fields

§property_name: &'a str

A property name.

§property_value: &'a str

A property value.

Implementations§

Trait Implementations§

source§

impl<'a> Debug for ClassQuery<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ClassQuery<'a>

§

impl<'a> RefUnwindSafe for ClassQuery<'a>

§

impl<'a> Send for ClassQuery<'a>

§

impl<'a> Sync for ClassQuery<'a>

§

impl<'a> Unpin for ClassQuery<'a>

§

impl<'a> UnwindSafe for ClassQuery<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.