pub enum RenameRule {
None,
LowerCase,
UpperCase,
PascalCase,
CamelCase,
SnakeCase,
ScreamingSnakeCase,
KebabCase,
ScreamingKebabCase,
}
Expand description
The different possible ways to change case of fields in a struct, or variants in an enum.
Variants§
None
Don’t apply a default rename rule.
LowerCase
Rename direct children to “lowercase” style.
UpperCase
Rename direct children to “UPPERCASE” 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.
ScreamingKebabCase
Rename direct children to “SCREAMING-KEBAB-CASE” style.
Implementations§
source§impl RenameRule
impl RenameRule
pub fn from_str(rename_all_str: &str) -> Result<Self, ParseError<'_>>
sourcepub fn apply_to_variant(self, variant: &str) -> String
pub fn apply_to_variant(self, variant: &str) -> String
Apply a renaming rule to an enum variant, returning the version expected in the source.
sourcepub fn apply_to_field(self, field: &str) -> String
pub fn apply_to_field(self, field: &str) -> String
Apply a renaming rule to a struct field, returning the version expected in the source.
Trait Implementations§
source§impl Clone for RenameRule
impl Clone for RenameRule
source§fn clone(&self) -> RenameRule
fn clone(&self) -> RenameRule
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl PartialEq for RenameRule
impl PartialEq for RenameRule
impl Copy 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
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)
clone_to_uninit
)