Enum ClassSetItem

pub enum ClassSetItem

A single component of a character class set.

Variants

Empty(Span)

An empty item.

Note that a bracketed character class cannot contain a single empty item. Empty items can appear when using one of the binary operators. For example, [&&] is the intersection of two empty classes.

Literal(Literal)

A single literal.

Range(ClassSetRange)

A range between two literals.

Ascii(ClassAscii)

An ASCII character class, e.g., [:alnum:] or [:punct:].

Unicode(ClassUnicode)

A Unicode character class, e.g., \pL or \p{Greek}.

Perl(ClassPerl)

A perl character class, e.g., \d or \W.

Bracketed(Box<ClassBracketed>)

A bracketed character class set, which may contain zero or more character ranges and/or zero or more nested classes. e.g., [a-zA-Z\pL].

Union(ClassSetUnion)

A union of items.

Implementations

impl ClassSetItem

fn span(&self) -> &Span

Return the span of this character class set item.

Trait Implementations

impl Clone for ClassSetItem

fn clone(&self) -> Self

impl Debug for ClassSetItem

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

impl Eq for ClassSetItem

impl PartialEq for ClassSetItem

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for ClassSetItem

Auto Trait Implementations

impl Freeze for ClassSetItem

impl RefUnwindSafe for ClassSetItem

impl Send for ClassSetItem

impl Sync for ClassSetItem

impl Unpin for ClassSetItem

impl UnsafeUnpin for ClassSetItem

impl UnwindSafe for ClassSetItem

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> CloneToUninit for ClassSetItem where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for ClassSetItem

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for ClassSetItem where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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