Enum syntax::ast::LitKind [−][src]
pub enum LitKind { Str(Symbol, StrStyle), ByteStr(Lrc<Vec<u8>>), Byte(u8), Char(char), Int(u128, LitIntType), Float(Symbol, FloatTy), FloatUnsuffixed(Symbol), Bool(bool), }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Literal kind.
E.g. "foo"
, 42
, 12.34
or bool
Variants
Str(Symbol, StrStyle)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A string literal ("foo"
)
ByteStr(Lrc<Vec<u8>>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A byte string (b"foo"
)
Byte(u8)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A byte char (b'f'
)
Char(char)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A character literal ('a'
)
Int(u128, LitIntType)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
An integer literal (1
)
Float(Symbol, FloatTy)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A float literal (1f64
or 1E10f64
)
FloatUnsuffixed(Symbol)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A float literal without a suffix (1.0 or 1.0E10
)
Bool(bool)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A boolean literal
Methods
impl LitKind
[src]
impl LitKind
pub fn is_str(&self) -> bool
[src]
pub fn is_str(&self) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns true if this literal is a string and false otherwise.
pub fn is_unsuffixed(&self) -> bool
[src]
pub fn is_unsuffixed(&self) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns true if this literal has no suffix. Note: this will return true for literals with prefixes such as raw strings and byte strings.
pub fn is_suffixed(&self) -> bool
[src]
pub fn is_suffixed(&self) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns true if this literal has a suffix.
impl LitKind
[src]
impl LitKind
fn token(&self) -> Token
[src]
fn token(&self) -> Token
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn from_token(token: Token) -> Option<LitKind>
[src]
fn from_token(token: Token) -> Option<LitKind>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Trait Implementations
impl Clone for LitKind
[src]
impl Clone for LitKind
fn clone(&self) -> LitKind
[src]
fn clone(&self) -> LitKind
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for LitKind
[src]
impl PartialEq for LitKind
fn eq(&self, other: &LitKind) -> bool
[src]
fn eq(&self, other: &LitKind) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &LitKind) -> bool
[src]
fn ne(&self, other: &LitKind) -> bool
This method tests for !=
.
impl Eq for LitKind
[src]
impl Eq for LitKind
fn assert_receiver_is_total_eq(&self)
[src]
fn assert_receiver_is_total_eq(&self)
impl Encodable for LitKind
[src]
impl Encodable for LitKind
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl Decodable for LitKind
[src]
impl Decodable for LitKind
fn decode<__D: Decoder>(d: &mut __D) -> Result<LitKind, __D::Error>
[src]
fn decode<__D: Decoder>(d: &mut __D) -> Result<LitKind, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl Hash for LitKind
[src]
impl Hash for LitKind
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for LitKind
[src]
impl Debug for LitKind