Enum clippy_lints::consts::Constant [] [src]

pub enum Constant {
    Str(String),
    Binary(Rc<Vec<u8>>),
    Char(char),
    Int(u128),
    F32(f32),
    F64(f64),
    Bool(bool),
    Vec(Vec<Constant>),
    Repeat(Box<Constant>, u64),
    Tuple(Vec<Constant>),
}

A LitKind-like enum to fold constant Exprs into.

Variants

a String "abc"

a Binary String b"abc"

a single char 'a'

an integer's bit representation

an f32

an f64

true or false

an array of constants

also an array, but with only one constant, repeated N times

a tuple of constants

Trait Implementations

impl Debug for Constant
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for Constant
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Constant
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Hash for Constant
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialOrd for Constant
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

impl !Send for Constant

impl !Sync for Constant