Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RustでつくるWebアプリケーション(1)
Search
NearMeの技術発表資料です
PRO
December 09, 2022
Programming
65
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RustでつくるWebアプリケーション(1)
NearMeの技術発表資料です
PRO
December 09, 2022
More Decks by NearMeの技術発表資料です
See All by NearMeの技術発表資料です
Claude Code × git worktree で並列開発 (続き) -差分のサービスだけを併設する-
nearme_tech
PRO
1
58
Claude Code × git worktree で並列開発 — サブモジュール構成のリポジトリで成立させる —
nearme_tech
PRO
0
74
LLM + 強化学習
nearme_tech
PRO
0
33
PosthogのA/Bテスト機能の紹介
nearme_tech
PRO
1
84
AIフレンドリーなプロダクトに向けて
nearme_tech
PRO
2
65
初めてのLean言語
nearme_tech
PRO
0
110
Apache Airflow Workflow orchestration without turning cron into spaghetti
nearme_tech
PRO
2
39
実務で役立つ幾何学 ボロノイ図の基礎から グラフ・ネットワーク応用まで
nearme_tech
PRO
1
78
SQL/ID抽出タスクから考える 実践的なハルシネーション対策
nearme_tech
PRO
1
92
Other Decks in Programming
See All in Programming
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
220
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
120
Agents on Rails - Rails at Scale 2026
irinanazarova
0
180
FreeBSDでZabbixを動かす
kenkino
0
320
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
250
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
140
setup-vp GitLab対応の裏側
naokihaba
0
120
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.2k
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
370
新卒PdEのリアル
ryu1013
1
510
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
190
アクセシビリティから考える情報設計
high_g_engineer
0
380
Featured
See All Featured
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
250
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
410
Accessibility Awareness
sabderemane
1
220
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
420
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
670
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
550
How STYLIGHT went responsive
nonsquared
100
6.3k
30 Presentation Tips
portentint
PRO
1
400
Transcript
0 RustでつくるWebアプリケーション(1) 2022-12-9 第24回NearMe技術勉強会 Asahi Kaito
1 今回から、本格的にアプリケーションを 作成していきます
2 今回は、 (1) Actixの使い方 (2) Rustの文法〜trait〜とは ついてまとめます。
3 今回用いるもの • Rust → これがなくては始まらない • Cargo → Rustのプロジェクト作成に必要
• Actix → Rust用のWebフレームワーク
4 Actixとは 公式Webサイトによると... “ Actix Web is a powerful, pragmatic,
and extremely fast web framework for Rust “ 高速なWebフレームワークをRustで作れますよということです! https://actix.rs/
5 Actixの例(基本編) use actix_web::{web, App, HttpRequest, HttpServer, Responder}; async fn
greet(req: HttpRequest) -> impl Responder { let name = req.match_info().get("name").unwrap_or("World"); format!("Hello {}!", &name) } #[actix_web::main] async fn main() -> std::io::Result<()> { HttpServer::new(|| { App::new() .route("/", web::get().to(greet)) .route("/{name}", web::get().to(greet)) }) .bind(("127.0.0.1", 8080))? .run() .await } https://actix.rs/
6 Actixの例(基本編) use actix_web::{web, App, HttpRequest, HttpServer, Responder}; async fn
greet(req: HttpRequest) -> impl Responder { let name = req.match_info().get("name").unwrap_or("World"); format!("Hello {}!", &name) } #[actix_web::main] async fn main() -> std::io::Result<()> { HttpServer::new(|| { App::new() .route("/", web::get().to(greet)) .route("/{name}", web::get().to(greet)) }) .bind(("127.0.0.1", 8080))? .run() .await } https://actix.rs/ “http://127.0.0.1:8080”に接続すると... “http://127.0.0.1:8080/{適当な文字列}”に接続すると...
7 〜ハンズオン中〜
8 Actixの例(getマクロを用いる) use actix_web::{get, web, App, HttpRequest, HttpServer, Responder}; #[get("/")]
async fn index(_req: HttpRequest) -> impl Responder { "Hello from the index page." } async fn hello(path: web::Path<String>) -> impl Responder { format!("Hello {}!", &path) } #[actix_web::main] async fn main() -> std::io::Result<()> { HttpServer::new(|| { App::new() .service(index) .route("/{name}", web::get().to(hello)) }).bind(("127.0.0.1", 8080))?.run().await } https://actix.rs/
9 Actixの例(getマクロを用いる) use actix_web::{get, web, App, HttpRequest, HttpServer, Responder}; #[get("/")]
async fn index(_req: HttpRequest) -> impl Responder { "Hello from the index page." } async fn hello(path: web::Path<String>) -> impl Responder { format!("Hello {}!", &path) } #[actix_web::main] async fn main() -> std::io::Result<()> { HttpServer::new(|| { App::new() .service(index) .route("/{name}", web::get().to(hello)) }).bind(("127.0.0.1", 8080))?.run().await } “http://127.0.0.1:8080”に接続すると... “http://127.0.0.1:8080/{適当な文字列}”に接続すると... https://actix.rs/
10 〜ハンズオン中〜
11 Rustの文法~traitとは?~ • trait = 型 → 複数の構造体などに同じような振る舞いを適用させたいときに 用い る
• traitの使い方 (1) traitを作成する (2) 構造体を作成する (3) implを用いて、traitを構造体に適用する
12 Rustの文法~traitとは?~ (1) traitを作成する pub trait Introduction { fn introduction(&self)
-> String; } (2) 構造体を作成する pub struct Pokemon { pub name: String, pub types: Vec<String>, pub tera_type: String, pub location: String, }
13 Rustの文法~traitとは?~ (3) implを用いて、traitを構造体に適用する impl Introduction for Pokemon { fn
introduction(&self) -> String { format!( "Name: {}, types: {:?}, tera_type: {}, location: {}", self.name, self.types, self.tera_type, self.location ) } }
14 〜ハンズオン中〜
15 Thank you