Expand description
Rust identifier and path construction helpers.
These are shared between buffa’s codegen and downstream code generators
(e.g. connectrpc-codegen) that emit Rust code alongside buffa’s message
types and need identical keyword-escaping and path-tokenization behavior.
The guarantee is that if buffa generates pub struct r#type::Foo { ... },
downstream callers using rust_path_to_tokens("type::Foo") produce the
matching r#type::Foo reference.
Functions§
- escape_
mod_ ident - Escape a proto package segment for use as a Rust
modname. - is_
rust_ keyword - Is
namea Rust keyword (strict, edition-2018+, edition-2024+, or reserved)? - make_
field_ ident - Create a field identifier, escaping Rust keywords.
- rust_
path_ to_ tokens - Parse a
::-separated Rust path string into aTokenStream, using raw identifiers (r#type) for segments that are Rust keywords.