Skip to main content

IdentExt

Trait IdentExt 

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

Source

fn with_prefix<I>(&self, prefix: I) -> Self
where I: IdentFragment,

Adds prefix to the identifier.

Source

fn with_suffix<I>(&self, suffix: I) -> Self
where I: IdentFragment,

Adds suffix to the identifier.

Source

fn to_snake_case(&self) -> Self

Converts the identifier to snake_case.

Source

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.

Implementations on Foreign Types§

Source§

impl IdentExt for Ident

Source§

fn with_prefix<I>(&self, prefix: I) -> Self
where I: IdentFragment,

Source§

fn with_suffix<I>(&self, suffix: I) -> Self
where I: IdentFragment,

Source§

fn to_snake_case(&self) -> Self

Source§

fn to_screaming_snake_case(&self) -> Self

Implementors§