Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 24 variants Decl(Decl), Import { module: String, span: Span, }, Export { names: Vec<String>, span: Span, }, Namespace { name: String, span: Span, }, End { span: Span, }, SetOption { name: String, value: String, span: Span, }, Open { path: Vec<String>, items: Vec<OpenItem>, span: Span, }, Section { name: String, span: Span, }, Variable { binders: Vec<Binder>, span: Span, }, Attribute { attrs: Vec<String>, name: String, span: Span, }, Check { expr_str: String, span: Span, }, Eval { expr_str: String, span: Span, }, Print { name: String, span: Span, }, Reduce { expr_str: String, span: Span, }, Universe { names: Vec<String>, span: Span, }, Notation { kind: NotationKind, name: String, prec: Option<u32>, body: String, span: Span, }, Derive { strategies: Vec<String>, type_name: String, span: Span, }, Structure { name: String, extends: Vec<String>, fields: Vec<StructureField>, derives: Vec<String>, span: Span, }, Class { name: String, params: Vec<Binder>, extends: Vec<String>, fields: Vec<StructureField>, span: Span, }, Instance { name: String, ty: String, priority: Option<u32>, body: String, span: Span, }, AttributeDecl { name: String, kind: AttributeDeclKind, span: Span, }, ApplyAttribute { attr_name: String, target: String, params: Vec<String>, span: Span, }, Syntax { name: String, prec: Option<u32>, pattern: String, span: Span, }, Precedence { name: String, level: u32, span: Span, },
}
Expand description

A top-level command.

Variants§

§

Decl(Decl)

Declaration command

§

Import

Import command

Fields

§module: String

Module name

§span: Span

Source span

§

Export

Export command

Fields

§names: Vec<String>

Names to export

§span: Span

Source span

§

Namespace

Namespace command

Fields

§name: String

Namespace name

§span: Span

Source span

§

End

End namespace/section command

Fields

§span: Span

Source span

§

SetOption

Set option command

Fields

§name: String

Option name

§value: String

Option value

§span: Span

Source span

§

Open

Open namespace command

Fields

§path: Vec<String>

Dotted path to namespace

§items: Vec<OpenItem>

Items to selectively open

§span: Span

Source span

§

Section

Section command

Fields

§name: String

Section name

§span: Span

Source span

§

Variable

Variable declaration

Fields

§binders: Vec<Binder>

Binders declared

§span: Span

Source span

§

Attribute

Attribute command

Fields

§attrs: Vec<String>

Attribute names

§name: String

Target name

§span: Span

Source span

§

Check

Check command (#check)

Fields

§expr_str: String

Expression to check (as string)

§span: Span

Source span

§

Eval

Eval command (#eval)

Fields

§expr_str: String

Expression to evaluate (as string)

§span: Span

Source span

§

Print

Print command (#print)

Fields

§name: String

Name to print

§span: Span

Source span

§

Reduce

Reduce command (#reduce)

Fields

§expr_str: String

Expression to reduce (as string)

§span: Span

Source span

§

Universe

Universe declaration

Fields

§names: Vec<String>

Universe variable names

§span: Span

Source span

§

Notation

Notation declaration

Fields

§kind: NotationKind

Notation kind

§name: String

Operator or notation name

§prec: Option<u32>

Precedence level

§body: String

Body (definition) of the notation

§span: Span

Source span

§

Derive

Derive command

Fields

§strategies: Vec<String>

Strategies to derive (e.g. DecidableEq, Repr)

§type_name: String

Type name to derive for

§span: Span

Source span

§

Structure

Structure command with fields and optional extends

Fields

§name: String

Structure name

§extends: Vec<String>

Extends clause (parent structures)

§fields: Vec<StructureField>

Field declarations

§derives: Vec<String>

Derive strategies

§span: Span

Source span

§

Class

Class command

Fields

§name: String

Class name

§params: Vec<Binder>

Class parameters (binders)

§extends: Vec<String>

Extends clause

§fields: Vec<StructureField>

Methods/fields

§span: Span

Source span

§

Instance

Instance declaration with priority

Fields

§name: String

Instance name

§ty: String

Instance type

§priority: Option<u32>

Priority (optional)

§body: String

Implementation body

§span: Span

Source span

§

AttributeDecl

Attribute declaration

Fields

§name: String

Attribute name

§kind: AttributeDeclKind

Attribute kind

§span: Span

Source span

§

ApplyAttribute

Attribute application

Fields

§attr_name: String

Attribute name

§target: String

Target name

§params: Vec<String>

Attribute parameters

§span: Span

Source span

§

Syntax

Syntax command

Fields

§name: String

Syntax name

§prec: Option<u32>

Precedence

§pattern: String

Pattern

§span: Span

Source span

§

Precedence

Precedence declaration

Fields

§name: String

Operator name

§level: u32

Precedence level

§span: Span

Source span

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Command

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.