ParserIssueCode

Enum ParserIssueCode 

Source
#[repr(u8)]
pub enum ParserIssueCode { UnreachableCode = 0, PHPOpeningTagNotSupported = 1, PHPClosingTagNotSupported = 2, UnitEnumCaseCannotHaveValue = 3, BackedEnumCaseMustHaveValue = 4, MissingItemDefinitionAfterAttributes = 5, ReservedKeywordCannotBeUsedForTypeName = 6, ReservedKeywordCannotBeUsedForConstantName = 7, TypeCannotBeUsedInCurrentContext = 8, MissingItemExpressionAfterAttributes = 9, InvalidEnumBackingType = 10, UnexpectedToken = 11, }

Variantsยง

ยง

UnreachableCode = 0

An unreachable code was encountered.

ยง

PHPOpeningTagNotSupported = 1

PHP opening tag is not supported ( code = 1 )

Example:

<?php

class Foo {}

Possible solution(s):

  • Remove the opening tag ( <?php )
ยง

PHPClosingTagNotSupported = 2

PHP closing tag is not supported ( code = 2 )

Example:

class Foo {}

?>

Possible solution(s):

  • Remove the closing tag ( ?> )
ยง

UnitEnumCaseCannotHaveValue = 3

Unit enum case cannot have a value ( code = 3 )

Example:

enum Foo {
   Bar = 1;
}

Possible solution(s):

  • Remove the value
  • Change the enum to a backed enum
ยง

BackedEnumCaseMustHaveValue = 4

Backed enum case must have a value ( code = 4 )

Example:

enum Foo: int {
  Bar;
}

Possible solution(s):

  • Add a value
  • Change the enum to a unit enum
ยง

MissingItemDefinitionAfterAttributes = 5

Missing item definition after attributes ( code = 7 )

Example:

#[Foo, Bar]

Possible solution(s):

  • Add an item definition after the attributes
  • Remove the attributes
ยง

ReservedKeywordCannotBeUsedForTypeName = 6

Reserved keyword cannot be used for type name ( code = 8 )

Example:

class if {}

Possible solution(s):

  • Use a different name
ยง

ReservedKeywordCannotBeUsedForConstantName = 7

Reserved keyword cannot be used for constant name ( code = 9 )

Example:

const if = 1;

Possible solution(s):

  • Use a different name
ยง

TypeCannotBeUsedInCurrentContext = 8

Type cannot be used in current context ( code = 10 )

Example:

use self;

Possible solution(s):

  • Use a different type
ยง

MissingItemExpressionAfterAttributes = 9

Missing item expression after attribute(s) ( code = 11 )

Example:

function foo(): void {
    #[Foo]
}

Possible solution(s):

  • Add an item expression after the attribute(s)
  • Remove the attribute(s)
ยง

InvalidEnumBackingType = 10

Enum backing type must be either int or string ( code = 12 )

Example:

enum: float {

}

Possible solution(s):

  • Change the backing type to int or string
ยง

UnexpectedToken = 11

Unexpected token ( code = 13 )

Example:

function foo() -> void {
}

Trait Implementationsยง

Sourceยง

impl Clone for ParserIssueCode

Sourceยง

fn clone(&self) -> ParserIssueCode

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 ParserIssueCode

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl Display for ParserIssueCode

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl From<ParserIssueCode> for String

Sourceยง

fn from(code: ParserIssueCode) -> Self

Converts to this type from the input type.
Sourceยง

impl Copy for ParserIssueCode

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

Sourceยง

fn __clone_box(&self, _: Private) -> *mut ()

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> ToString for T
where T: Display + ?Sized,

Sourceยง

fn to_string(&self) -> String

Converts the given value to a String. 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.