Expand description
Shared syn::Type shape utilities — the Option/Vec/reference peelers and
short-name helpers every pipeline stage needs. One definition here
replaces the per-module copies that used to live in core::unfold,
core::expand, and the jnigen adapter.
Functions§
- bare_
path_ ident - The bare ident of a plain path type (
ZThing→ZThing);Nonefor references, generics, or multi-shape types. - ident
- Build an identifier at call-site span.
- is_
result_ type - True when
tyisResult<…>(by last path segment). - option_
inner_ type - If
tyisOption<Inner>(by last path segment), returnInner. - pascal_
to_ snake - Convert a
PascalCase/camelCaseidentifier tosnake_case(ZKeyExpr→z_key_expr). The single implementation behind the publicsnake_casere-export in theprebindgen-ccrate, and behind cbindgen’s type-name mangling. - path_
tail_ ident - Last path-segment ident of a path type, generics permitting
(
Option<T>→Option,Vec<u8>→Vec). Contrast withbare_path_ident, which isNonefor any generic/non-path shape. - result_
ok_ type - If
tyisResult<T, E>, returnT. - result_
parts - If
tyisResult<T, E>(by last path segment), return(T, E). - vec_
inner_ type - If
tyisVec<Inner>(by last path segment), returnInner.