Enum ident_case::RenameRule
source · pub enum RenameRule {
None,
LowerCase,
PascalCase,
CamelCase,
SnakeCase,
ScreamingSnakeCase,
KebabCase,
}
Expand description
A casing rule for renaming Rust identifiers.
Variants§
None
No-op rename rule.
LowerCase
Rename direct children to “lowercase” style.
PascalCase
Rename direct children to “PascalCase” style, as typically used for enum variants.
CamelCase
Rename direct children to “camelCase” style.
SnakeCase
Rename direct children to “snake_case” style, as commonly used for fields.
ScreamingSnakeCase
Rename direct children to “SCREAMING_SNAKE_CASE” style, as commonly used for constants.
KebabCase
Rename direct children to “kebab-case” style.
Implementations§
source§impl RenameRule
impl RenameRule
sourcepub fn apply_to_variant<S: AsRef<str>>(&self, variant: S) -> String
pub fn apply_to_variant<S: AsRef<str>>(&self, variant: S) -> String
Change case of a PascalCase
variant.
sourcepub fn apply_to_field<S: AsRef<str>>(&self, field: S) -> String
pub fn apply_to_field<S: AsRef<str>>(&self, field: S) -> String
Change case of a snake_case
field.
Trait Implementations§
source§impl Clone for RenameRule
impl Clone for RenameRule
source§fn clone(&self) -> RenameRule
fn clone(&self) -> RenameRule
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RenameRule
impl Debug for RenameRule
source§impl Default for RenameRule
impl Default for RenameRule
source§impl FromStr for RenameRule
impl FromStr for RenameRule
source§impl PartialEq for RenameRule
impl PartialEq for RenameRule
impl Copy for RenameRule
impl Eq for RenameRule
impl StructuralPartialEq for RenameRule
Auto Trait Implementations§
impl Freeze for RenameRule
impl RefUnwindSafe for RenameRule
impl Send for RenameRule
impl Sync for RenameRule
impl Unpin for RenameRule
impl UnwindSafe for RenameRule
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)