pub trait Iden {
// Required method
fn unquoted(&self) -> &str;
// Provided methods
fn quoted(&self) -> Cow<'static, str> { ... }
fn to_string(&self) -> String { ... }
}
Expand description
Identifier
Required Methods§
Provided Methods§
Sourcefn quoted(&self) -> Cow<'static, str>
fn quoted(&self) -> Cow<'static, str>
Return the to-be sanitized version of the identifier.
For example, for MySQL “hello
” would have to be escaped as “hel``lo”.
Note that this method doesn’t do the actual escape,
as it’s backend specific.
It only indicates whether the identifier needs to be escaped.
If the identifier doesn’t need to be escaped, return 'static str
.
This can be deduced at compile-time by the Iden
macro,
or using the is_static_iden
function.
Cow::Owned
would always be escaped.