Enum syntax::ast::LitKind
[−]
[src]
pub enum LitKind {
Str(Symbol, StrStyle),
ByteStr(Rc<Vec<u8>>),
Byte(u8),
Char(char),
Int(u128, LitIntType),
Float(Symbol, FloatTy),
FloatUnsuffixed(Symbol),
Bool(bool),
}rustc_private)Literal kind.
E.g. "foo", 42, 12.34 or bool
Variants
Str(Symbol, StrStyle)rustc_private)A string literal ("foo")
ByteStr(Rc<Vec<u8>>)rustc_private)A byte string (b"foo")
Byte(u8)rustc_private)A byte char (b'f')
Char(char)rustc_private)A character literal ('a')
Int(u128, LitIntType)rustc_private)An integer literal (1)
Float(Symbol, FloatTy)rustc_private)A float literal (1f64 or 1E10f64)
FloatUnsuffixed(Symbol)rustc_private)A float literal without a suffix (1.0 or 1.0E10)
Bool(bool)rustc_private)A boolean literal
Methods
impl LitKind[src]
fn is_str(&self) -> bool
rustc_private)Returns true if this literal is a string and false otherwise.
fn is_unsuffixed(&self) -> bool
rustc_private)Returns true if this literal has no suffix. Note: this will return true for literals with prefixes such as raw strings and byte strings.
fn is_suffixed(&self) -> bool
rustc_private)Returns true if this literal has a suffix.
Trait Implementations
impl Clone for LitKind[src]
fn clone(&self) -> LitKind
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl PartialEq for LitKind[src]
fn eq(&self, __arg_0: &LitKind) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &LitKind) -> bool
This method tests for !=.
impl Eq for LitKind[src]
impl Encodable for LitKind[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private)
deprecated in favor of rustc-serialize on crates.io
impl Decodable for LitKind[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<LitKind, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private)
deprecated in favor of rustc-serialize on crates.io
impl Hash for LitKind[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher1.3.0
Feeds a slice of this type into the state provided.