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§
source§impl 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§
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§fn default() -> RenameRule
fn default() -> RenameRule
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for RenameRule
impl<'de> Deserialize<'de> for RenameRule
source§fn 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