bomboni_core crate provides internal utilities and abstractions used throughout the Bomboni library. This crate is primarily used by other Bomboni crates and procedural macros.
String Utilities
The string module provides utilities for string case conversion.str_to_case
Converts a string to the specified case format.Converts a string to the specified case using smart boundary detection.Parameters:
s- The input string to convertcase- The target case format fromconvert_case::Case
Case Enum
TheCase enum is re-exported from the convert_case crate and supports various case formats:
Case::Upper- UPPERCASECase::Lower- lowercaseCase::Title- Title CaseCase::Camel- camelCaseCase::Pascal- PascalCaseCase::Snake- snake_caseCase::UpperSnake- UPPER_SNAKE_CASECase::Kebab- kebab-caseCase::Cobol- COBOL-CASECase::Train- Train-CaseCase::Flat- flatcaseCase::UpperFlat- UPPERFLATCASE
Syntax Tree Utilities
Thesyn module provides utilities for working with Rust syntax trees in procedural macros.
format_comment!
Macro for formatting documentation comments in procedural macros.type_is_phantom
Checks if a type isPhantomData.
Returns
true if the given type is std::marker::PhantomData.Parameters:ty- A reference to asyn::Typeto check
true if the type is PhantomData, false otherwisetype_is_option
Checks if a type isOption.
Returns
true if the given type is std::option::Option.Parameters:ty- A reference to asyn::Typeto check
true if the type is Option, false otherwiseUsage in Procedural Macros
Thebomboni_core crate is primarily designed for use in procedural macros within the Bomboni ecosystem. Here’s an example of how these utilities might be used:
String Case Conversion Examples
Dependencies
Thebomboni_core crate depends on:
convert_case- For string case conversionsyn- For Rust syntax tree manipulation (withfullfeature)