Enum cbindgen::RenameRule
source · pub enum RenameRule {
None,
GeckoCase,
LowerCase,
UpperCase,
PascalCase,
CamelCase,
SnakeCase,
ScreamingSnakeCase,
QualifiedScreamingSnakeCase,
}
Expand description
A rule to apply to an identifier when generating bindings.
Variants
None
Do not apply any renaming. The default.
GeckoCase
Converts the identifier to PascalCase and adds a context dependent prefix
LowerCase
Converts the identifier to lower case.
UpperCase
Converts the identifier to upper case.
PascalCase
Converts the identifier to PascalCase.
CamelCase
Converts the identifier to camelCase.
SnakeCase
Converts the identifier to snake_case.
ScreamingSnakeCase
Converts the identifier to SCREAMING_SNAKE_CASE.
QualifiedScreamingSnakeCase
Converts the identifier to SCREAMING_SNAKE_CASE and prefixes enum variants with the enum name.
Implementations
sourceimpl RenameRule
impl RenameRule
sourcepub fn apply_to_pascal_case(
&self,
text: &str,
context: IdentifierType<'_>
) -> String
pub fn apply_to_pascal_case(
&self,
text: &str,
context: IdentifierType<'_>
) -> String
Applies the rename rule to a string that is formatted in PascalCase.
sourcepub fn apply_to_snake_case(
&self,
text: &str,
context: IdentifierType<'_>
) -> String
pub fn apply_to_snake_case(
&self,
text: &str,
context: IdentifierType<'_>
) -> String
Applies the rename rule to a string that is formatted in snake_case.
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 moresourceimpl Debug for RenameRule
impl Debug for RenameRule
sourceimpl Default for RenameRule
impl Default for RenameRule
sourcefn default() -> RenameRule
fn default() -> RenameRule
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for RenameRule
impl<'de> Deserialize<'de> for RenameRule
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl FromStr for RenameRule
impl FromStr for RenameRule
impl Copy 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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