rust_development
БесплатноБез исполняемых скриптовНе проверенRust systems programming, memory safety, Axum/Tokio ve WebAssembly rehberi.
Об этом скилле
🦀 Rust Development
Rust systems programming rehberi.
📋 Temel Syntax
// Variables
let x = 5; // Immutable
let mut y = 10; // Mutable
// Functions
fn add(a: i32, b: i32) -> i32 {
a + b // No semicolon = return
}
// Structs
struct User {
name: String,
age: u32,
}
// Enums
enum Status {
Active,
Inactive,
Pending(String),
}
🔒 Ownership & Borrowing
// Ownership
let s1 = String::from("hello");
let s2 = s1; // s1 moved to s2
// Borrowing
fn print(s: &String) {
println!("{}", s);
}
// Mutable borrow
fn append(s: &mut String) {
s.push_str(" world");
}
⚡ Axum Web Framework
use axum::{routing::get, Router, Json};
use serde::Serialize;
#[derive(Serialize)]
struct User { name: String }
async fn get_user() -> Json<User> {
Json(User { name: "John".into() })
}
#[tokio::main]
async fn main() {
let app = Router::new()
.route("/user", get(get_user));
axum::serve(listener, app).await.unwrap();
}
🔄 Async with Tokio
use tokio;
#[tokio::main]
async fn main() {
let result = fetch_data().await;
}
async fn fetch_data() -> String {
tokio::time::sleep(Duration::from_secs(1)).await;
"data".to_string()
}
🎯 Error Handling
use anyhow::Result;
use thiserror::Error;
#[derive(Error, Debug)]
enum AppError {
#[error("Not found: {0}")]
NotFound(String),
}
fn find_user(id: &str) -> Result<User> {
// Returns Result with anyhow
Ok(user)
}
Rust Development v1.1 - Enhanced
🔄 Workflow
Aşama 1: Project Setup & Structure
- Workspace: Büyük projeler için Cargo Workspace yapısını kur (Monorepo).
- Linter:
clippy'yi en sıkı modda (-D warnings) çalıştıracak şekilde CI pipeline'ına ekle. - Dependency Management:
cargo-denyile lisans ve güvenlik kontrolü yap.
Aşama 2: Implementation Patterns
- Error Handling: Kütüphaneler için
thiserror, uygulamalar içinanyhowkullan. Aslaunwrap()kullanma (testler hariç). - Async Runtime: Web sunucuları için
tokioveaxum(veyaactix-web) standartını benimse. - Type Safety: "Newtype Pattern" kullanarak primitive obsession'dan kaçın (
struct UserId(Uuid)).
Aşama 3: Performance & Reliability
- Tracing:
tracingvetracing-subscriberile structured logging kur.println!kullanma. - Benchmarks: Kritik fonksiyonlar için
criterionile benchmark testleri yaz. - Release Profile: Production build için
Cargo.tomliçindelto = truevecodegen-units = 1ayarlarını yap.
Kontrol Noktaları
| Aşama | Doğrulama |
|---|---|
| 1 | cargo clippy hatasız geçiyor mu? ve cargo fmt uygulandı mı? |
| 2 | Tüm public API'ler dökümante edildi mi? (/// doc comments). |
| 3 | Docker imajı distroless veya alpine tabanlı optimize edildi mi? |
Установить rust_development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл rust_development?
Rust systems programming, memory safety, Axum/Tokio ve WebAssembly rehberi.
Как установить скилл rust_development?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rust_development запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic