pub struct Ident(/* private fields */);Expand description
A single identifier naming a definition, as it appears in the syntax tree.
This is the form that renders: ToSql quotes the name whenever emitting
it bare would read back as something else, so a definition’s name survives
being rendered and re-parsed. Statements hold this rather than a String
or a Strand because both of those render their contents verbatim, which
makes an unquoted name the silent default and a round-trip failure the
result.
Escaping is decided here, once, so a statement can interpolate the name directly and be correct. A statement that reaches for an escaper itself is choosing a different rule than every other definition name.
Every position this appears in is introduced by a sigil or a path separator
($name, mod::name, ml::name), so a reserved word is unambiguous there
and is emitted bare. A name in a position where it could instead be read as
a keyword needs crate::TableName’s stricter rule, not this one.
This is for names that are a single identifier. It is not the right type for
a ::-separated path such as a function name, whose segments are escaped
individually, and not for a name that may be computed at runtime, which is
an Expr.
Implementations§
Trait Implementations§
impl Eq for Ident
Source§impl Ord for Ident
impl Ord for Ident
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Ident
impl PartialOrd 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 UnsafeUnpin 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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.