(code: string)
| 1272 | } |
| 1273 | |
| 1274 | function collectNonDefaultableRustTypeNames(code: string): Set<string> { |
| 1275 | const names = new Set<string>(); |
| 1276 | const pattern = |
| 1277 | /#\[derive\(Debug, Clone, Serialize, Deserialize\)\](?:\r?\n#\[serde\([^\n]+\)\])*\r?\npub (?:struct|enum) (\w+)/g; |
| 1278 | for (const match of code.matchAll(pattern)) { |
| 1279 | names.add(match[1]); |
| 1280 | } |
| 1281 | return names; |
| 1282 | } |
| 1283 | |
| 1284 | // ── API types generation ──────────────────────────────────────────────────── |
| 1285 |