Skip to main content

Pattern

Enum Pattern 

Source
pub enum Pattern<'a> {
Show 14 variants Anything, Var(&'a str), Record(&'a [&'a Located<&'a str>]), Alias { pattern: &'a Located<Pattern<'a>>, name: &'a Located<&'a str>, }, Unit, Pair { first: &'a Located<Pattern<'a>>, second: &'a Located<Pattern<'a>>, }, Tuple { first: &'a Located<Pattern<'a>>, second: &'a Located<Pattern<'a>>, rest: &'a [&'a Located<Pattern<'a>>], }, Ctor { region: Region, name: &'a str, args: &'a [&'a Located<Pattern<'a>>], }, CtorQual { region: Region, module: &'a str, name: &'a str, args: &'a [&'a Located<Pattern<'a>>], }, List(&'a [&'a Located<Pattern<'a>>]), Cons { head: &'a Located<Pattern<'a>>, tail: &'a Located<Pattern<'a>>, }, Str(&'a str), Bytes(&'a [u8]), Int(i128),
}

Variants§

§

Anything

§

Var(&'a str)

§

Record(&'a [&'a Located<&'a str>])

§

Alias

Fields

§pattern: &'a Located<Pattern<'a>>
§name: &'a Located<&'a str>
§

Unit

§

Pair

Fields

§first: &'a Located<Pattern<'a>>
§second: &'a Located<Pattern<'a>>
§

Tuple

Fields

§first: &'a Located<Pattern<'a>>
§second: &'a Located<Pattern<'a>>
§rest: &'a [&'a Located<Pattern<'a>>]
§

Ctor

Fields

§region: Region
§name: &'a str
§args: &'a [&'a Located<Pattern<'a>>]
§

CtorQual

Fields

§region: Region
§module: &'a str
§name: &'a str
§args: &'a [&'a Located<Pattern<'a>>]
§

List(&'a [&'a Located<Pattern<'a>>])

§

Cons

Fields

§head: &'a Located<Pattern<'a>>
§tail: &'a Located<Pattern<'a>>
§

Str(&'a str)

§

Bytes(&'a [u8])

§

Int(i128)

Trait Implementations§

Source§

impl<'a> Debug for Pattern<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Forget for Pattern<'a>

§

impl<'a> Freeze for Pattern<'a>

§

impl<'a> Move for Pattern<'a>

§

impl<'a> RefUnwindSafe for Pattern<'a>

§

impl<'a> Send for Pattern<'a>

§

impl<'a> Sync for Pattern<'a>

§

impl<'a> Unpin for Pattern<'a>

§

impl<'a> UnsafeUnpin for Pattern<'a>

§

impl<'a> UnwindSafe for Pattern<'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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.