Trait Iden

pub trait Iden: 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§

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§

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

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

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§

§

impl Debug for dyn Iden

§

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

Formats the value using the given formatter. Read more

Implementations on Foreign Types§

§

impl Iden for &str

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

Reused for other string-like types.

§

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

§

impl Iden for Column

§

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

§

impl Iden for Entity

§

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

§

impl Iden for Has

§

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

§

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

§

impl Iden for PrimaryKey

§

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

§

impl Iden for SqliteMaster

§

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

§

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

§

impl Iden for SqliteSchema

§

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

§

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

Implementors§

§

impl Iden for Identity

§

impl Iden for MySqlType

§

impl Iden for Alias

Reuses the impl for the underlying str.

§

impl Iden for NullAlias

§

impl Iden for SelectA

§

impl Iden for SelectB

§

impl Iden for SelectC

§

impl Iden for PgLTree