Enum LiteralKind

pub enum LiteralKind

The kind of a single literal expression.

Variants

Verbatim

The literal is written verbatim, e.g., a or ☃.

Meta

The literal is written as an escape because it is otherwise a special regex meta character, e.g., \* or \[.

Superfluous

The literal is written as an escape despite the fact that the escape is unnecessary, e.g., \% or \/.

Octal

The literal is written as an octal escape, e.g., \141.

HexFixed(HexLiteralKind)

The literal is written as a hex code with a fixed number of digits depending on the type of the escape, e.g., \x61 or \u0061 or \U00000061.

HexBrace(HexLiteralKind)

The literal is written as a hex code with a bracketed number of digits. The only restriction is that the bracketed hex code must refer to a valid Unicode scalar value.

Special(SpecialLiteralKind)

The literal is written as a specially recognized escape, e.g., \f or \n.

Trait Implementations

impl Clone for LiteralKind

fn clone(&self) -> Self

impl Debug for LiteralKind

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

impl Eq for LiteralKind

impl PartialEq for LiteralKind

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

impl StructuralPartialEq for LiteralKind

Auto Trait Implementations

impl Freeze for LiteralKind

impl RefUnwindSafe for LiteralKind

impl Send for LiteralKind

impl Sync for LiteralKind

impl Unpin for LiteralKind

impl UnsafeUnpin for LiteralKind

impl UnwindSafe for LiteralKind

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for LiteralKind

fn from(t: T) -> T

Returns the argument unchanged.

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

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

impl<T, U> Into<U> for LiteralKind 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 LiteralKind where U: Into<T>,

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

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

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