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
sourceimpl 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
sourceimpl Clone for RenameRule
impl Clone for RenameRule
sourcefn clone(&self) -> RenameRule
fn clone(&self) -> RenameRule
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RenameRule
impl Debug for RenameRule
sourceimpl Default for RenameRule
impl Default for RenameRule
sourceimpl FromStr for RenameRule
impl FromStr for RenameRule
sourceimpl PartialEq<RenameRule> for RenameRule
impl PartialEq<RenameRule> for RenameRule
impl Copy for RenameRule
impl Eq for RenameRule
impl StructuralEq for RenameRule
impl StructuralPartialEq for RenameRule
Auto Trait Implementations
impl RefUnwindSafe for RenameRule
impl Send for RenameRule
impl Sync for RenameRule
impl Unpin for RenameRule
impl UnwindSafe for RenameRule
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more