Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

microsoft-rust-training

БесплатноБез исполняемых скриптовНе проверен

Comprehensive Rust training curriculum from Microsoft covering beginner to expert levels across 7 books with exercises, diagrams, and playgrounds.

reason-machinesот reason-machines★ 99 звёзд на GitHub

Об этом скилле

Microsoft Rust Training

Skill by ara.so — Daily 2026 Skills collection.

A collection of seven structured Rust training books maintained by Microsoft, covering Rust from multiple entry points (C/C++, C#/Java, Python backgrounds) through deep dives on async, advanced patterns, type-level correctness, and engineering practices. Each book contains 15–16 chapters with Mermaid diagrams, editable Rust playgrounds, and exercises.


Book Catalog

Book Level Focus
c-cpp-book 🟢 Bridge Move semantics, RAII, FFI, embedded, no_std
csharp-book 🟢 Bridge C#/Java/Swift → ownership & type system
python-book 🟢 Bridge Dynamic → static typing, GIL-free concurrency
async-book 🔵 Deep Dive Tokio, streams, cancellation safety
rust-patterns-book 🟡 Advanced Pin, allocators, lock-free structures, unsafe
type-driven-correctness-book 🟣 Expert Type-state, phantom types, capability tokens
engineering-book 🟤 Practices Build scripts, cross-compilation, CI/CD, Miri

Installation & Setup

Prerequisites

# Install Rust via rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install mdBook and Mermaid preprocessor
cargo install mdbook mdbook-mermaid

Clone and Build

git clone https://github.com/microsoft/RustTraining.git
cd RustTraining

# Build all books into site/
cargo xtask build

# Serve all books locally at http://localhost:3000
cargo xtask serve

# Build for GitHub Pages deployment (outputs to docs/)
cargo xtask deploy

# Clean build artifacts
cargo xtask clean

Serve a Single Book

cd c-cpp-book && mdbook serve --open     # http://localhost:3000
cd python-book && mdbook serve --open
cd async-book && mdbook serve --open

Repository Structure

RustTraining/
├── c-cpp-book/
│   ├── book.toml
│   └── src/
│       ├── SUMMARY.md          # Table of contents
│       └── *.md                # Chapter files
├── csharp-book/
├── python-book/
├── async-book/
├── rust-patterns-book/
├── type-driven-correctness-book/
├── engineering-book/
├── xtask/                      # Build automation (cargo xtask)
│   └── src/main.rs
├── docs/                       # GitHub Pages output
├── site/                       # Local preview output
└── .github/workflows/
    └── pages.yml               # Auto-deploy on push to master

mdBook Configuration (book.toml)

Each book contains a book.toml. Example configuration pattern:

[book]
title = "Async Rust"
authors = ["Microsoft"]
language = "en"
src = "src"

[build]
build-dir = "../site/async-book"

[preprocessor.mermaid]
command = "mdbook-mermaid"

[output.html]
default-theme = "navy"
preferred-dark-theme = "navy"
git-repository-url = "https://github.com/microsoft/RustTraining"
edit-url-template = "https://github.com/microsoft/RustTraining/edit/master/{path}"

[output.html.search]
enable = true

Key Rust Concepts Covered by Book

Bridge: Rust for C/C++ Programmers

Ownership & Move Semantics

// C++ has copy by default; Rust moves by default
fn take_ownership(s: String) {
    println!("{s}");
} // s is dropped here

fn main() {
    let s = String::from("hello");
    take_ownership(s);
    // println!("{s}"); // ERROR: s was moved
    
    // Use clone for explicit deep copy
    let s2 = String::from("world");
    let s3 = s2.clone();
    println!("{s2} {s3}"); // Both valid
}

RAII — No Manual Memory Management

use std::fs::File;
use std::io::{self, Write};

fn write_data(path: &str, data: &[u8]) -> io::Result<()> {
    let mut file = File::create(path)?; // Opens file
    file.write_all(data)?;
    Ok(())
} // file automatically closed here — no explicit close needed

FFI Example

// Calling C from Rust
extern "C" {
    fn abs(x: i32) -> i32;
}

fn main() {
    unsafe {
        println!("abs(-5) = {}", abs(-5));
    }
}

Bridge: Rust for Python Programmers

Static Typing with Type Inference

// Python: x = [1, 2, 3]
// Rust infers the type from usage:
let mut numbers = Vec::new();
numbers.push(1_i32);
numbers.push(2);
numbers.push(3);

// Explicit when needed:
let numbers: Vec<i32> = vec![1, 2, 3];

Error Handling (no exceptions)

use std::num::ParseIntError;

fn double_number(s: &str) -> Result<i32, ParseIntError> {
    let n = s.trim().parse::<i32>()?; // ? propagates error
    Ok(n * 2)
}

fn main() {
    match double_number("5") {
        Ok(n) => println!("Doubled: {n}"),
        Err(e) => println!("Error: {e}"),
    }
}

GIL-Free Concurrency

use std::thread;
use std::sync::{Arc, Mutex};

fn main() {
    let counter = Arc::new(Mutex::new(0));
    let mut handles = vec![];

    for _ in 0..10 {
        let counter = Arc::clone(&counter);
        let handle = thread::spawn(move || {
            let mut num = counter.lock().unwrap();
Полный SKILL.md на GitHub

Установить microsoft-rust-training в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл microsoft-rust-training?

Comprehensive Rust training curriculum from Microsoft covering beginner to expert levels across 7 books with exercises, diagrams, and playgrounds.

Как установить скилл microsoft-rust-training?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл microsoft-rust-training запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить microsoft-rust-training с