Skip to main content

python_safe_name

Function python_safe_name 

Source
pub fn python_safe_name(name: &str) -> Option<String>
Expand description

Return the escaped field name for use in the generated binding of the given language, or None if the name is not reserved and no escaping is needed.

The escape strategy appends _ to the name (e.g. classclass_). Call sites should use the returned value as the Rust field name in the binding struct and add language-appropriate attribute annotations to preserve the original name in the user-facing API.