Enum cql3_parser::common::Identifier
source · [−]Expand description
Identifers are either Quoted or Unquoted.
- Unquoted Identifiers: are case insensitive
- Quoted Identifiers: are case sensitive. double quotes appearing within the quoted string are escaped by doubling (i.e.
"foo""bar" is interpreted asfoo“bar`)
Quoted lower lower case is equivalent to unquoted mixed case. Quoted( myid ) == Unquoted( myid ) Quoted( myid ) == Unquoted( “myId” ) Quoted( myid ) != Quoted( “myId” )
It is possible to create an Unquoted identifier with an embedded quote (e.g. Identifier::Unquoted( "foo\"bar" )).
Note that a quote as the first character in an Unquoted Identifier can cause problems if the Identifier is converted
to a string and then parsed again as the second parse will create a Quoted identifier.
Variants
Quoted(String)
This variant is case sensitive “fOo”“bAr”“” is stored as fOo“bAr“
Unquoted(String)
This variant is case insensitive Only ascii alphanumeric and _ characters are allowed in this variant fOo_bAr is stored as fOo_bAr
Implementations
sourceimpl Identifier
impl Identifier
sourcepub fn parse(text: &str) -> Identifier
pub fn parse(text: &str) -> Identifier
parses strings as returned by the parser into Quoted or Unquoted Identifiers.
- Unquoted Identifiers: are case insensitive
- Quoted Identifiers: are case sensitive. double quotes appearing within the quoted string
are escaped by doubling (i.e.
"foo""bar" is interpreted asfoo“bar`)
If the string starts with " it is assumed to be a quoted identifier, the leading and trailing quotes are removed
and the internal doubled quotes ("") are converted to simple quotes (").
Trait Implementations
sourceimpl Clone for Identifier
impl Clone for Identifier
sourcefn clone(&self) -> Identifier
fn clone(&self) -> Identifier
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresourceimpl Debug for Identifier
impl Debug for Identifier
sourceimpl Default for Identifier
impl Default for Identifier
sourceimpl<'de> Deserialize<'de> for Identifier
impl<'de> Deserialize<'de> for Identifier
sourcefn 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>,
sourceimpl Display for Identifier
impl Display for Identifier
sourceimpl From<&String> for Identifier
impl From<&String> for Identifier
sourceimpl From<&str> for Identifier
impl From<&str> for Identifier
sourceimpl Hash for Identifier
impl Hash for Identifier
sourceimpl Ord for Identifier
impl Ord for Identifier
sourcefn cmp(&self, other: &Identifier) -> Ordering
fn cmp(&self, other: &Identifier) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialEq<Identifier> for Identifier
impl PartialEq<Identifier> for Identifier
sourceimpl PartialOrd<Identifier> for Identifier
impl PartialOrd<Identifier> for Identifier
sourcefn partial_cmp(&self, other: &Identifier) -> Option<Ordering>
fn partial_cmp(&self, other: &Identifier) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more