Enum StatementType

Source
pub enum StatementType {
Show 16 variants Eof, Invalid, Comment, TypesettingComment, HeadingComment(HeadingLevel), AdditionalInfoComment, FileInclude, Axiom, Provable, Essential, Floating, Disjoint, OpenGroup, CloseGroup, Constant, Variable,
}
Expand description

An enumeration of statement types, most of which correspond to statements as defined in the Metamath spec.

Variants§

§

Eof

Psuedo statement used only to record end-of-file whitespace.

§

Invalid

Statement which is damaged enough that there’s no sense passing it to later stages.

§

Comment

Comments between statements are recorded as statements in their own right to facilitate handling of date comments and other metadata.

§

TypesettingComment

A comment which starts with a $t token and must be interpreted specially by the HTML generator.

§

HeadingComment(HeadingLevel)

A comment corresponding to the head of a chapter or section in the outline

§

AdditionalInfoComment

A comment which starts with a $j token and must be interpreted specially by the grammar parser

§

FileInclude

A $[ directive; we process these as statements, and disallow them inside other statements, which violates the published Metamath spec but is allowed behavior as an erratum.

Such statements always end the current segment.

§

Axiom

A spec $a statement.

§

Provable

A spec $p statement.

§

Essential

A spec $e statement.

§

Floating

A spec $f statement.

§

Disjoint

A spec $d statement.

§

OpenGroup

A spec ${ statement.

§

CloseGroup

A spec $} statement.

§

Constant

A spec $c statement.

§

Variable

A spec $v statement.

Implementations§

Source§

impl StatementType

Source

pub const fn is_assertion(self) -> bool

Returns true if this statement is an Axiom ($a) or Provable ($p) statement.

Source

pub const fn takes_label(self) -> bool

Returns true if this statement has a label before the keyword: $a $p $e $f.

Source

pub const fn takes_math(self) -> bool

Returns true if this statement is followed by math tokens: $a $p $e $f $d $c $v.

Trait Implementations§

Source§

impl Clone for StatementType

Source§

fn clone(&self) -> StatementType

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 StatementType

Source§

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

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

impl Default for StatementType

Source§

fn default() -> StatementType

Returns the “default value” for a type. Read more
Source§

impl PartialEq for StatementType

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for StatementType

Source§

impl Eq for StatementType

Source§

impl StructuralPartialEq for StatementType

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.