(value: &LitStr)
| 166 | } |
| 167 | |
| 168 | fn parse_role(value: &LitStr) -> Result<RoleLit> { |
| 169 | match value.value().as_str() { |
| 170 | "admin" => Ok(RoleLit::Admin), |
| 171 | "user" => Ok(RoleLit::User), |
| 172 | other => Err(Error::new( |
| 173 | value.span(), |
| 174 | format!("invalid role `{other}`; expected `admin` or `user`"), |
| 175 | )), |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | /// Convert a Rust snake_case method identifier to the tonic PascalCase |
| 180 | /// gRPC method name (`list_sandboxes` → `ListSandboxes`). |