Today marks the official release of the v0.0.1 version of typed-ident!
This is a project that initially started out as just some internal utility library, but needed to be factored out for formally releasing another project that I’m working on. In the process, I ended up doing a bunch of work to make it as complete of an implementation as possible.
There’s already some things I’m not a fan of, so a v0.0.2 is scheduled to release very soon. However, if you would like to play around with this early alpha, you can on crates.io now.
You can add the dependency by editing your Cargo.toml:
[dependencies]
typed-ident = "0.0.1"
Or by using cargo add:
cargo add typed-ident
The expected way to use this crate is by selecting a preset, and using the types that are predefined for you.
use typed_ident::presets::unicode::*;
// Validate the format of input to see that it matches expectations.
let identifier = UpperCamelIdent::new("HTTPServer")?;
// Look at all of the atomic segments of the identifier.
println!("identifier segments:");
for segment in identifier.segments() {
println!("* {segment:?}"); // [Chunk("HTTP"), Chunk("Server")]
}
// Decorate and mutate (requires `alloc` feature).
let decorated = identifier.with_circumfix_str("__", "__")?;
println!("with decoration: {decorated}"); // "__HTTPServer__"
You can read the documentation for more usage information.
Since this is the initial release, the whole crate is new and so there are no iterative changes.
Thank you for taking a look at this project, and I hope you enjoy using it!