Iden

Trait Iden 

Source
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§

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<(), Error>

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)

Source§

impl Iden for Column

Source§

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

Source§

impl Iden for PrimaryKey

Source§

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

Source§

impl Iden for Has

Source§

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

Source§

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

Source§

impl Iden for SqliteSchema

Source§

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

Source§

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

Source§

impl Iden for Entity

Source§

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

Source§

impl Iden for SqliteMaster

Source§

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

Source§

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

Implementors§

Source§

impl Iden for Identity

Source§

impl Iden for MySqlType

Source§

impl Iden for PgLTree

Source§

impl Iden for SelectA

Source§

impl Iden for SelectB

Source§

impl Iden for SelectC

Source§

impl Iden for Alias

Reuses the impl for the underlying str.

Source§

impl Iden for NullAlias