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<S>(value: S) -> Selfwhere
S: Into<String>,
pub fn new<S>(value: S) -> Selfwhere S: Into<String>,
Create a new identifier with the given value and no quotes.
sourcepub fn with_quote<S>(quote: char, value: S) -> Selfwhere
S: Into<String>,
pub fn with_quote<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.
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 moresource§impl VisitMut for Ident
impl VisitMut for Ident
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
impl Eq for Ident
impl StructuralEq for Ident
impl StructuralPartialEq for Ident
Auto Trait Implementations§
impl RefUnwindSafe for Ident
impl Send for Ident
impl Sync for Ident
impl Unpin for Ident
impl UnwindSafe for Ident
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more