Skip to main content

PatternKind

Enum PatternKind 

Source
pub enum PatternKind {
Show 14 variants Box(PatternBox), Byte(PatternByte), ByteString(PatternByteString), Character(PatternCharacter), Ident(PatternIdent), MacroCall(PatternMacroCall), Number(PatternNumber), RangeExclusive(PatternRangeExclusive), RangeInclusive(PatternRangeInclusive), Reference(PatternReference), Slice(PatternSlice), String(PatternString), Struct(PatternStruct), Tuple(PatternTuple),
}

Variants§

Implementations§

Source§

impl PatternKind

Source

pub fn into_box(self) -> Option<PatternBox>

Source

pub fn into_byte(self) -> Option<PatternByte>

Source

pub fn into_byte_string(self) -> Option<PatternByteString>

Source

pub fn into_character(self) -> Option<PatternCharacter>

Source

pub fn into_ident(self) -> Option<PatternIdent>

Source

pub fn into_macro_call(self) -> Option<PatternMacroCall>

Source

pub fn into_number(self) -> Option<PatternNumber>

Source

pub fn into_range_exclusive(self) -> Option<PatternRangeExclusive>

Source

pub fn into_range_inclusive(self) -> Option<PatternRangeInclusive>

Source

pub fn into_reference(self) -> Option<PatternReference>

Source

pub fn into_slice(self) -> Option<PatternSlice>

Source

pub fn into_string(self) -> Option<PatternString>

Source

pub fn into_struct(self) -> Option<PatternStruct>

Source

pub fn into_tuple(self) -> Option<PatternTuple>

Source

pub fn as_box(&self) -> Option<&PatternBox>

Source

pub fn as_byte(&self) -> Option<&PatternByte>

Source

pub fn as_byte_string(&self) -> Option<&PatternByteString>

Source

pub fn as_character(&self) -> Option<&PatternCharacter>

Source

pub fn as_ident(&self) -> Option<&PatternIdent>

Source

pub fn as_macro_call(&self) -> Option<&PatternMacroCall>

Source

pub fn as_number(&self) -> Option<&PatternNumber>

Source

pub fn as_range_exclusive(&self) -> Option<&PatternRangeExclusive>

Source

pub fn as_range_inclusive(&self) -> Option<&PatternRangeInclusive>

Source

pub fn as_reference(&self) -> Option<&PatternReference>

Source

pub fn as_slice(&self) -> Option<&PatternSlice>

Source

pub fn as_string(&self) -> Option<&PatternString>

Source

pub fn as_struct(&self) -> Option<&PatternStruct>

Source

pub fn as_tuple(&self) -> Option<&PatternTuple>

Source

pub fn is_box(&self) -> bool

Source

pub fn is_byte(&self) -> bool

Source

pub fn is_byte_string(&self) -> bool

Source

pub fn is_character(&self) -> bool

Source

pub fn is_ident(&self) -> bool

Source

pub fn is_macro_call(&self) -> bool

Source

pub fn is_number(&self) -> bool

Source

pub fn is_range_exclusive(&self) -> bool

Source

pub fn is_range_inclusive(&self) -> bool

Source

pub fn is_reference(&self) -> bool

Source

pub fn is_slice(&self) -> bool

Source

pub fn is_string(&self) -> bool

Source

pub fn is_struct(&self) -> bool

Source

pub fn is_tuple(&self) -> bool

Trait Implementations§

Source§

impl Debug for PatternKind

Source§

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

Formats the value using the given formatter. Read more
Source§

impl HasExtent for PatternKind

Source§

fn extent(&self) -> Extent

Source§

impl<'a> Index<&'a PatternKind> for str

Source§

type Output = str

The returned type after indexing.
Source§

fn index(&self, i: &'a PatternKind) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<PatternKind> for str

Source§

type Output = str

The returned type after indexing.
Source§

fn index(&self, i: PatternKind) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Visit for PatternKind

Source§

fn visit<'ast, V>(&'ast self, v: &mut V)
where V: Visitor<'ast>,

Source§

fn visit_mut<V>(&mut self, v: &mut V)
where V: VisitorMut,

Auto Trait Implementations§

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>,

Source§

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>,

Source§

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.