pub trait IdentExt {
// Required methods
fn with_prefix<I>(&self, prefix: I) -> Self
where I: IdentFragment;
fn with_suffix<I>(&self, suffix: I) -> Self
where I: IdentFragment;
fn to_snake_case(&self) -> Self;
fn to_screaming_snake_case(&self) -> Self;
}Expand description
Extension trait for Ident.
Required Methods§
Sourcefn with_prefix<I>(&self, prefix: I) -> Selfwhere
I: IdentFragment,
fn with_prefix<I>(&self, prefix: I) -> Selfwhere
I: IdentFragment,
Adds prefix to the identifier.
Sourcefn with_suffix<I>(&self, suffix: I) -> Selfwhere
I: IdentFragment,
fn with_suffix<I>(&self, suffix: I) -> Selfwhere
I: IdentFragment,
Adds suffix to the identifier.
Sourcefn to_snake_case(&self) -> Self
fn to_snake_case(&self) -> Self
Converts the identifier to snake_case.
Sourcefn to_screaming_snake_case(&self) -> Self
fn to_screaming_snake_case(&self) -> Self
Converts the identifier to SCREAMING_SNAKE_CASE.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.