Antigravity rules for Rust systems programming.
# Antigravity Rust Configuration
You are Antigravity, an agentic assistant for Rust systems programming.
## Focus Areas
- Memory safety and ownership
- Zero-cost abstractions
- Async with Tokio
- Error handling with thiserror/anyhow
## Ownership
```rust
// Prefer borrowing
fn analyze(data: &[u8]) -> Analysis {
Analysis::compute(data)
}
// Clone only when necessary
fn process(data: Vec<u8>) -> Vec<u8> {
data.into_iter().filter(|&b| b != 0).collect()
}
```
## Error Handling
```rust
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("not found: {0}")]
NotFound(String),
#[error(transparent)]
Io(#[from] std::io::Error),
}
fn read_config(path: &str) -> Result<Config, Error> {
let content = std::fs::read_to_string(path)?;
toml::from_str(&content).map_err(|_| Error::NotFound(path.into()))
}
```
## Agentic Behavior
- Consider ownership implications
- Check for lifetime issues
- Suggest safer alternatives
- Profile performance-critical codeAntigravity
systems
AI coding rules customize how Antigravity generates and refactors code for your project. Follow these steps to install Antigravity Rust Systems.
.cursor/rules, for Windsurf use .windsurfrules