Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rustのweb開発を助ける 便利なツール紹介
Search
Yuki Ishii
July 16, 2024
Programming
1
460
Rustのweb開発を助ける 便利なツール紹介
Rustの web開発がもっと楽になる、そんなツールの紹介です。
Yuki Ishii
July 16, 2024
Tweet
Share
More Decks by Yuki Ishii
See All by Yuki Ishii
Server側でStateを使用した時の情報漏洩の危険性を見てみる
yuki0418
1
100
Other Decks in Programming
See All in Programming
Gleamという選択肢
comamoca
6
760
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
230
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
260
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
360
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
350
ドメインモデリングにおける抽象の役割、tagless-finalによるDSL構築、そして型安全な最適化
knih
11
2k
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
130
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
150
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
4
930
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
980
Cline指示通りに動かない? AI小説エージェントで学ぶ指示書の書き方と自動アップデートの仕組み
kamomeashizawa
1
570
関数型まつりレポート for JuliaTokai #22
antimon2
0
150
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
16
940
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Docker and Python
trallard
44
3.4k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Visualization
eitanlees
146
16k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
Being A Developer After 40
akosma
90
590k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Transcript
Rustのweb開発を助ける 便利なツール紹介 Yuki Ishii (いっしー)
自己紹介 - Yuki Ishii (いっしー) 開発: Web Development 経歴: ex-CyberAgent
はこぶね便事務局 (現 ひとりエンジニア) 使用言語: Rust, Svelte X: @YukiIshii10 Blog: https://blog.yuki-dev.com/ 副業もしてます
Summary 目的: 少しでも Rust でのWeb開発を楽しくなるように ターゲット : Rustで開発をしている人・はじめようとしてる人 今回は簡単な紹介になります。 どれも素敵なツールなので深い機能などは是非調べてみてください!
紹介する ツール - cargo-clippy - cargo-fmt - cargo-machete - cargo-nextest
- cargo-make - Cargo-audit - testcontainers-rs - VScode extension - crates
cargo-clippy cargo-fmt
cargo-clippy と cargo-fmt みんな大好き Rustの公式 Linter と Formatter. clippy は
静的解析ツールで 未使用の変数や関数、Clippy Lintsというサイトで定義され ている文法の場合は warn または deny を教えてくれます。 Clippy Lints: https://rust-lang.github.io/rust-clippy/master/index.html fmt は公式の フォーマッターで style guidelines に基づいて 自動でフォーマットをかけ てくれます。
cargo-clippy 円周率などの数学定数を扱った場合 $ cargo clippy をすると下記のように表示されます。
cargo-clippy 今回の円周率の場合は PI というconstant が用意されているのでそちらを使うように教 えてくれたので変更。
cargo-fmt $ cargo fmt で 自動的にオートフォーマットをかけてくれます。 無駄な new line や
スペースを消したり、見やすいように改行してくれます。 VS Code なら下記の設定を追加すると on save で自動で format をかけてくれます。
cargo-machete
cargo-machete 未使用の dependencies を教えてくれます。 例では serde を使ってない事を教えてくれました。
cargo-machete Actionが用意されてるので主に マージ前にチェックしてます。
cargo-nextest
cargo-nextest Rust の test runner です。 Features: - cargo test
に比べて 2x - 3x 早いです (ベンチマーク参照) - cargo test より UI が綺麗です - Slow and leaky テストを検知してくれます - pre-built binaries 用意されてるので CI 導入が楽です - config が豊富 - Doctests がまだサポートされてません・・・
cargo-nextest cargo test cargo nextest
cargo-make
cargo-make Rust の task runner です。機能がやたら豊富です。 Features: - Tasks, Dependencies,
and Aliases - Commands, Scripts, and Sub Tasks - Conditions - Environment Variables - Other Programming Languages - etc…
cargo-make Makefile.toml
cargo-make 他の言語もインストールしてなくても Script で実行できました。
cargo-audit
cargo-audit 脆弱性がある dependencies を教えてくれます。 RustSec Advisory Database という `rustsec/advisory-db` のレポジトリーにレポートが
あった Advisories を元に検知してます。 Dependabot みたいな感じです。
cargo-audit 例) libflate という crate の脆弱性
testcontainers-rs
testcontainers-rs テスト環境に必要な外部ツールなどをコンテナとして用意してくれます。これによって 外 部接続のモジュールなどをモックしたり、Dockerを用意する必要がなく、簡単にテストが 行うことができます。 また作成されたコンテナはスコープが外れたら自動的に削除されます。 例として redis を必要としてるアプリケーションのテスト時にコードから redis
server を動 かしてるコンテナを起動します。
testcontainers-rs 例) redis v7.2.4 をテスト時だけ起動する。(port 60874は自動的割り当て)
testcontainers-rs Community メンテされている testcontainers-modules を使用すればいろんな Image が module として提供されてます。
VScode extension crates
crates Cargo.toml ないの dependencies を管理するのに便利な機能を提供してます。 - Version 情報提供 - Commandで全ての
dependencies のバージョンをアップデート - Crev (Rust の public code review) のリンク表示 - Doc.rs のリンク表示
crates - Cargo.toml を開くと バージョンが 古い場合は 視覚的に教えてくれま す。 - 有効なバージョン一覧を表示してく
れます。 - crate.io, doc.rs, Crev(Check Reviews)のリンクを表示してくれま す。
crates Command で Cargo.toml ないの dependencies を update してくれます。 (あんまり使ってないかも)
eof Thank you @YukiIshii10