pub struct Ident {
pub(crate) value: String,
pub(crate) 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_unchecked<S>(value: S) -> Self
pub fn new_unchecked<S>(value: S) -> Self
Create a new identifier with the given value and no quotes. the given value must not be a empty string.
sourcepub fn with_quote_unchecked<S>(quote: char, value: S) -> Self
pub fn with_quote_unchecked<S>(quote: char, value: S) -> Self
Create a new quoted identifier with the given quote and value. the given value must not be a empty string and the given quote must be in [‘'’, ‘“’, ‘`’, ‘[’].
sourcepub fn with_quote_check<S>(quote: char, value: S) -> Result<Ident, ParserError>
pub fn with_quote_check<S>(quote: char, value: S) -> Result<Ident, ParserError>
Create a new quoted identifier with the given quote and value. returns ParserError when the given string is empty or the given quote is illegal.
sourcepub fn real_value(&self) -> String
pub fn real_value(&self) -> String
Value after considering quote style In certain places, double quotes can force case-sensitive, but not always e.g. session variables.
pub fn quote_style(&self) -> Option<char>
Trait Implementations§
impl Eq for Ident
impl StructuralPartialEq for Ident
Auto Trait Implementations§
impl Freeze for Ident
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more