Skip to main content

split_lvalue_spec

Function split_lvalue_spec 

Source
pub fn split_lvalue_spec(
    body: &str,
) -> Result<(&str, Option<LvalueSpec>), String>
Expand description

Public form of extract_lvalue_spec for adapters that need to interleave bind-point processing with text generation (e.g., the cassandra-cpp resolve_structural_and_mark_remaining walker, which scans the statement text char-by-char and must strip a lvalue-spec suffix from a bind-point body before deciding whether to inline-resolve or ?-mark the position).

Returns (bare_name, Some(spec)) when the body carries a lvalue-spec suffix; (body, None) otherwise. The first half of the tuple is always the body with any :* or :<type> suffix stripped.

Fails when the suffix names a type but not one a workload may assert: a spelling polydat retired ({id:String}: “String is no longer a type keyword; write str”) or an internal-only type (handle, ext).