Enum salvo_core::extract::RenameRule
source · #[non_exhaustive]pub enum RenameRule {
LowerCase,
UpperCase,
PascalCase,
CamelCase,
SnakeCase,
ScreamingSnakeCase,
KebabCase,
ScreamingKebabCase,
}
Expand description
Rename rule for a field.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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
sourcepub fn apply_to_variant(&self, variant: impl AsRef<str>) -> String
pub fn apply_to_variant(&self, variant: impl AsRef<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
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 FromStr for RenameRule
impl FromStr for RenameRule
source§impl PartialEq for RenameRule
impl PartialEq for RenameRule
source§fn eq(&self, other: &RenameRule) -> bool
fn eq(&self, other: &RenameRule) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.