pub struct Ident {
pub value: String,
pub quote_style: Option<char>,
}
Expand description
An identifier, decomposed into its value or character data and the quote style.
Fields§
§value: String
The value of the identifier without quotes.
quote_style: Option<char>
The starting quote if any. Valid quote characters are the single quote, double quote, backtick, and opening square bracket.
Implementations§
source§impl Ident
impl Ident
sourcepub fn new_unlocated<S>(value: S) -> Selfwhere
S: Into<String>,
pub fn new_unlocated<S>(value: S) -> Selfwhere S: Into<String>,
Create a new identifier with the given value and no quotes.
sourcepub fn new<S>(value: S) -> Located<Self>where
S: Into<String>,
pub fn new<S>(value: S) -> Located<Self>where S: Into<String>,
Create a new identifier with the given value and no quotes.
pub fn new_located<S>(value: S, range: Range) -> Located<Self>where S: Into<String>,
sourcepub fn with_quote_unlocated<S>(quote: char, value: S) -> Selfwhere
S: Into<String>,
pub fn with_quote_unlocated<S>(quote: char, value: S) -> Selfwhere S: Into<String>,
Create a new quoted identifier with the given quote and value. This function panics if the given quote is not a valid quote character.
pub fn with_quote<S>(quote: char, value: S) -> Located<Self>where S: Into<String>,
pub fn with_quote_located<S>(quote: char, value: S, range: Range) -> Located<Self>where S: Into<String>,
pub fn into_located(self, range: Range) -> Located<Self>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Ident
impl<'de> Deserialize<'de> for Ident
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Ident
impl Ord for Ident
source§impl PartialEq<Ident> for Ident
impl PartialEq<Ident> for Ident
source§impl PartialOrd<Ident> for Ident
impl PartialOrd<Ident> for Ident
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more