Enum Literal

Source
pub enum Literal {
    BooleanLiteral(BooleanLiteral),
    IntegerLiteral(IntegerLiteral),
    HexLiteral(IntegerLiteral),
    BinaryLiteral(IntegerLiteral),
    FloatLiteral(FloatLiteral),
    CharLiteral(CharLiteral),
    StringLiteral(StringLiteral),
    FunctionCall(Identifier),
    Null,
}

Variants§

§

BooleanLiteral(BooleanLiteral)

§

IntegerLiteral(IntegerLiteral)

§

HexLiteral(IntegerLiteral)

§

BinaryLiteral(IntegerLiteral)

§

FloatLiteral(FloatLiteral)

§

CharLiteral(CharLiteral)

§

StringLiteral(StringLiteral)

§

FunctionCall(Identifier)

§

Null

Implementations§

Source§

impl Literal

Source

pub fn is_boolean_literal(&self) -> bool

Returns true if this is a Literal::BooleanLiteral, otherwise false

Source

pub fn as_boolean_literal_mut(&mut self) -> Option<&mut BooleanLiteral>

Optionally returns mutable references to the inner fields if this is a Literal::BooleanLiteral, otherwise None

Source

pub fn as_boolean_literal(&self) -> Option<&BooleanLiteral>

Optionally returns references to the inner fields if this is a Literal::BooleanLiteral, otherwise None

Source

pub fn into_boolean_literal(self) -> Result<BooleanLiteral, Self>

Returns the inner fields if this is a Literal::BooleanLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_integer_literal(&self) -> bool

Returns true if this is a Literal::IntegerLiteral, otherwise false

Source

pub fn as_integer_literal_mut(&mut self) -> Option<&mut IntegerLiteral>

Optionally returns mutable references to the inner fields if this is a Literal::IntegerLiteral, otherwise None

Source

pub fn as_integer_literal(&self) -> Option<&IntegerLiteral>

Optionally returns references to the inner fields if this is a Literal::IntegerLiteral, otherwise None

Source

pub fn into_integer_literal(self) -> Result<IntegerLiteral, Self>

Returns the inner fields if this is a Literal::IntegerLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_hex_literal(&self) -> bool

Returns true if this is a Literal::HexLiteral, otherwise false

Source

pub fn as_hex_literal_mut(&mut self) -> Option<&mut IntegerLiteral>

Optionally returns mutable references to the inner fields if this is a Literal::HexLiteral, otherwise None

Source

pub fn as_hex_literal(&self) -> Option<&IntegerLiteral>

Optionally returns references to the inner fields if this is a Literal::HexLiteral, otherwise None

Source

pub fn into_hex_literal(self) -> Result<IntegerLiteral, Self>

Returns the inner fields if this is a Literal::HexLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_binary_literal(&self) -> bool

Returns true if this is a Literal::BinaryLiteral, otherwise false

Source

pub fn as_binary_literal_mut(&mut self) -> Option<&mut IntegerLiteral>

Optionally returns mutable references to the inner fields if this is a Literal::BinaryLiteral, otherwise None

Source

pub fn as_binary_literal(&self) -> Option<&IntegerLiteral>

Optionally returns references to the inner fields if this is a Literal::BinaryLiteral, otherwise None

Source

pub fn into_binary_literal(self) -> Result<IntegerLiteral, Self>

Returns the inner fields if this is a Literal::BinaryLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_float_literal(&self) -> bool

Returns true if this is a Literal::FloatLiteral, otherwise false

Source

pub fn as_float_literal_mut(&mut self) -> Option<&mut FloatLiteral>

Optionally returns mutable references to the inner fields if this is a Literal::FloatLiteral, otherwise None

Source

pub fn as_float_literal(&self) -> Option<&FloatLiteral>

Optionally returns references to the inner fields if this is a Literal::FloatLiteral, otherwise None

Source

pub fn into_float_literal(self) -> Result<FloatLiteral, Self>

Returns the inner fields if this is a Literal::FloatLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_char_literal(&self) -> bool

Returns true if this is a Literal::CharLiteral, otherwise false

Source

pub fn as_char_literal_mut(&mut self) -> Option<&mut CharLiteral>

Optionally returns mutable references to the inner fields if this is a Literal::CharLiteral, otherwise None

Source

pub fn as_char_literal(&self) -> Option<&CharLiteral>

Optionally returns references to the inner fields if this is a Literal::CharLiteral, otherwise None

Source

pub fn into_char_literal(self) -> Result<CharLiteral, Self>

Returns the inner fields if this is a Literal::CharLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_string_literal(&self) -> bool

Returns true if this is a Literal::StringLiteral, otherwise false

Source

pub fn as_string_literal_mut(&mut self) -> Option<&mut StringLiteral>

Optionally returns mutable references to the inner fields if this is a Literal::StringLiteral, otherwise None

Source

pub fn as_string_literal(&self) -> Option<&StringLiteral>

Optionally returns references to the inner fields if this is a Literal::StringLiteral, otherwise None

Source

pub fn into_string_literal(self) -> Result<StringLiteral, Self>

Returns the inner fields if this is a Literal::StringLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_function_call(&self) -> bool

Returns true if this is a Literal::FunctionCall, otherwise false

Source

pub fn as_function_call_mut(&mut self) -> Option<&mut Identifier>

Optionally returns mutable references to the inner fields if this is a Literal::FunctionCall, otherwise None

Source

pub fn as_function_call(&self) -> Option<&Identifier>

Optionally returns references to the inner fields if this is a Literal::FunctionCall, otherwise None

Source

pub fn into_function_call(self) -> Result<Identifier, Self>

Returns the inner fields if this is a Literal::FunctionCall, otherwise returns back the enum in the Err case of the result

Source

pub fn is_null(&self) -> bool

Returns true if this is a Literal::Null, otherwise false

Source§

impl Literal

Source

pub fn is_valid(&self) -> bool

Trait Implementations§

Source§

impl Clone for Literal

Source§

fn clone(&self) -> Literal

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 Default for Literal

Source§

fn default() -> Literal

Returns the “default value” for a type. 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.