Rust プロジェクトのための開発テンプレート
このプロジェクトは、Rust 開発を始めるためのボイラープレートです。Dev Containers に対応しており、VS Code での開発環境が簡単に構築できます。
- Docker
- Visual Studio Code
- VS Code Dev Containers 拡張機能
- リポジトリをクローン:
git clone <repository-url>
cd boilerplate-rust- VS Codeでプロジェクトを開く:
code .- VS Codeのコマンドパレット(
Ctrl+Shift+P/Cmd+Shift+P)から「Dev Containers: Reopen in Container」を選択
すべてのタスクは mise run <task> で実行します。
mise run build # デバッグビルド
mise run build:release # リリースビルド
mise run test # テスト実行
mise run test:watch # TDD ウォッチモード
mise run test:doc # ドキュメントテストmise run fmt # フォーマット (cargo fmt + dprint)
mise run fmt:check # フォーマットチェック
mise run clippy # Lint
mise run clippy:strict # Lint (warnings をエラー扱い)
mise run ast-grep # ast-grep カスタムルールチェックmise run pre-commit # clean:sweep + fmt:check + clippy:strict + ast-grep + lint:gh.
├── .cargo/ # Cargo設定
│ └── config.toml
├── .devcontainer/ # Dev Container設定
│ ├── devcontainer.json # Dev Container設定ファイル
│ ├── initializeCommand.sh # 初期化コマンド
│ └── postStartCommand.sh # 起動後コマンド
├── .githooks/ # Git hooks (mise run 連携)
│ ├── commit-msg # Conventional Commits 検証
│ ├── pre-commit # コミット前チェック
│ └── pre-push # プッシュ前チェック
├── .github/ # GitHub Actions & 設定
│ ├── actions/ # カスタムアクション
│ ├── gh-sync/ # gh-sync マニフェスト (テンプレートリポジトリからのファイル同期設定)
│ ├── workflows/ # CI/CD ワークフロー
│ ├── labeler.yml
│ ├── project-config.json # CI/リリース設定 (ビルドターゲット・タイムアウト・apt パッケージ等)
│ └── release.yml
├── .mise/ # mise タスク定義
│ ├── tasks.toml # 共通タスク定義 (boilerplate から管理)
│ └── overrides.toml # プロジェクト固有のタスク上書き
├── .vscode/ # VS Code設定
│ ├── launch.json # デバッグ設定
│ └── settings.json # ワークスペース設定
├── ast-rules/ # ast-grep プロジェクトルール
├── crates/ # ワークスペースクレート
│ └── brust/ # CLI バイナリクレート
│ ├── src/
│ │ ├── main.rs # アプリケーションのエントリーポイント
│ │ ├── libs.rs # モジュール定義
│ │ ├── metrics.rs # OTel メトリクス instruments
│ │ └── libs/
│ │ ├── count.rs # イテレーションカウンターモジュール
│ │ ├── hello.rs # Hello モジュール
│ │ └── http.rs # HTTP クライアント (OTel メトリクス付き)
│ ├── tests/
│ │ └── integration_test.rs # 統合テスト
│ ├── build.rs # ビルドスクリプト
│ └── Cargo.toml # クレート設定
├── docs/ # ドキュメント
├── .editorconfig # エディター設定
├── .gitignore # Git除外設定
├── .octocov.yml # カバレッジレポート設定
├── .tagpr # タグ&リリース設定
├── Cargo.lock # 依存関係のロックファイル
├── Cargo.toml # ワークスペース設定と共有依存関係
├── deny.toml # cargo-deny 設定
├── Dockerfile # Dockerイメージ定義
├── dprint.jsonc # Dprint フォーマッター設定
├── LICENSE # ライセンスファイル
├── mise.toml # ツール管理 (タスクは .mise/ を参照)
├── README.md # このファイル
├── renovate.json # Renovate自動依存関係更新設定
├── rust-toolchain.toml # Rust toolchain バージョン固定
└── sgconfig.yml # ast-grep 設定ファイル
このプロジェクトの Dev Containers には、Rust開発を効率化する以下の拡張機能が含まれています:
- rust-analyzer - Rust言語サポート(コード補完、エラー検出、リファクタリング)
- CodeLLDB - Rustプログラムのデバッグサポート
- Even Better TOML - Cargo.tomlファイルのシンタックスハイライトとバリデーション
- Biome - 高速なフォーマッターとリンター
- dprint - 高速なコードフォーマッター(設定ファイル:
dprint.jsonc) - EditorConfig for VS Code - エディター設定の統一
- Error Lens - エラーと警告をインラインで表示
- Claude Code for VSCode - AIアシスタントによるコーディング支援
- Calculate - 選択したテキストの計算式を評価
- indent-rainbow - インデントレベルを色分け表示
- Local History - ファイルの変更履歴をローカルに保存
- lowercase - 選択テキストを小文字に変換
- uppercase - 選択テキストを大文字に変換
- Markdown All in One - Markdownファイルの編集支援
このプロジェクトは LICENSE ファイルに記載されているライセンスの下で公開されています。
Dev Container の起動時に OpenObserve Enterprise Edition が自動的にダウンロード・インストールされます。Enterprise 版は MCP (Model Context Protocol) サーバー機能など OSS 版にはない付加機能を備えているため採用しています。Enterprise 版は 200GB/Day のインジェストクォータ内であれば無料で利用できます。
OpenObserve Enterprise Edition は EULA (End User License Agreement) の下で提供されており、OSS 版 (AGPL-3.0) とはライセンスが異なります。Enterprise 版の機能一覧は OpenObserve Enterprise を参照してください。
RUST_LOG=trace RUST_BACKTRACE=1 cargo run -- help