# tss-rust
[](https://crates.io/crates/tss-rust)
[](https://docs.rs/tss-rust)
[](../../LICENSE)
Generated node type enums and metadata from tree-sitter-rust.
## Usage
```toml
[dependencies]
tss-rust = "0.1"
tree-sitter = "0.24"
tree-sitter-rust = "0.24"
```
```rust
use tree_sitter_symbols_rust::NodeType;
use std::str::FromStr;
let node_type = NodeType::from_str("function_item")?;
assert_eq!(node_type, NodeType::FunctionItem);
assert_eq!(node_type.to_string(), "function_item");
```
## Features
Default includes all metadata:
```toml
tss-rust = "0.1"
```
Select specific metadata:
```toml
tss-rust = { version = "0.1", default-features = false, features = ["meta-named", "meta-fields"] }
```
Available metadata features:
- `meta-named` - whether nodes are named in the grammar
- `meta-subtypes` - possible subtypes for each node
- `meta-fields` - named fields nodes can have
- `meta-children` - anonymous children nodes can have
- `meta-extra` - extra node markers
- `meta-root` - root node markers
## How It Works
At build time, reads `tree-sitter-rust`'s `NODE_TYPES` constant and generates:
- A `NodeType` enum with all 280+ node types
- `FromStr` for parsing node type strings
- `Display` for converting back to strings
- Documentation linking to Rust language reference
Zero runtime dependencies - all generation happens at compile time.
## Licensing
MIT licensed - see [LICENSE](https://github.com/lmmx/tss/blob/master/LICENSE) for details.