Trait Iden

Source
pub trait Iden
where Self: Send + Sync,
{ // Required method fn unquoted(&self, s: &mut dyn Write); // Provided methods fn prepare(&self, s: &mut dyn Write, q: Quote) { ... } fn quoted(&self, q: Quote) -> String { ... } fn to_string(&self) -> String { ... } }
Expand description

Identifier

Required Methods§

Source

fn unquoted(&self, s: &mut dyn Write)

Write a raw identifier string without quotes.

We indentionally don’t reuse Display for this, because we want to allow it to have a different logic.

Provided Methods§

Source

fn prepare(&self, s: &mut dyn Write, q: Quote)

Source

fn quoted(&self, q: Quote) -> String

Source

fn to_string(&self) -> String

A shortcut for writing an unquoted identifier into a String.

We can’t reuse ToString for this, because ToString uses the Display representation. Bnd Iden representation is distinct from Display and can be different.

Trait Implementations§

Source§

impl Debug for dyn Iden

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementations on Foreign Types§

Source§

impl Iden for &str

The “base” impl for writing arbitrary “raw” strings as identifiers.

Reused for other string-like types.

Source§

fn unquoted(&self, s: &mut dyn Write)

Implementors§

Source§

impl Iden for MySqlType

Available on crate feature backend-mysql only.
Source§

impl Iden for PgLTree

Available on crate feature backend-postgres only.
Source§

impl Iden for Alias

Reuses the impl for the underlying str.

Source§

impl Iden for NullAlias