Enum LiteralKind

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.

Implementations

impl Clone for LiteralKind

fn clone(self: &Self) -> LiteralKind

impl Debug for LiteralKind

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

impl Eq for LiteralKind

impl Freeze for LiteralKind

impl PartialEq for LiteralKind

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

impl RefUnwindSafe for LiteralKind

impl Send for LiteralKind

impl StructuralPartialEq for LiteralKind

impl Sync for LiteralKind

impl Unpin for LiteralKind

impl UnsafeUnpin for LiteralKind

impl UnwindSafe for LiteralKind

impl<T> Any for LiteralKind

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for LiteralKind

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for LiteralKind

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

impl<T> CloneToUninit for LiteralKind

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

impl<T> From for LiteralKind

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for LiteralKind

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for LiteralKind

fn into(self: 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 for LiteralKind

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

impl<T, U> TryInto for LiteralKind

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