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のLINEBot SDKを自作した話
Search
Yuto Takamune
September 29, 2023
Programming
2.6k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RustのLINEBot SDKを自作した話
Yuto Takamune
September 29, 2023
Transcript
9 slides
RustのLINEBot SDKを自作した話 しんぶんぶん
自己紹介 • 名前: しんぶんぶん • 所属: 会津大学学部3年 • Twitter: @shinbunbun_,
@4fa19623 • LINE API Expert / seccamp ’23 / Cybozu labyouth 13th ◦ セキュキャン: 分散合意ゼミ(Raft) ◦ ラボユース: CRDTを使ったP2P分散データベースの開発
LINE Messaging APIについて/今回作ったもの • いわゆるLINEBotを作るのに必要な API • 各言語でSDKが公式から提供されて いる •
Rustは公式で提供されていないので 自作してみた • リポジトリ: https://github.com/shinbunbun/line- bot-sdk-rust LINEBot→
実装したもの • 基本的には構造体の型を定義してい く作業 • LINEから送られてくるメッセージと サーバから送信するメッセージそれぞ れの型を、ドキュメントを見ながら地道 に書いた •
いろいろなAPIがあるので、それらの ラッパーを書いた
使用した(主な)Crate • awc ◦ APIを叩くのに使用 • typed-builder ◦ 型レベルビルダーパターンでメッセージの structを構築できるようにした
• thiserror ◦ エラーハンドリングを良い感じにするのに使用
使用イメージ
使用イメージ
SDKを使ったサンプル実装 • Hands-on LINEBOT Rust編 Vol.1 ◦ 技術書典で頒布した本 • リポジトリ
◦ https://github.com/shinbunbun/Hands-on-LINEB OT-Rust-Vol.1
みんなもRustでLINEBot作ろう!
More Decks by Yuto Takamune
See All by Yuto Takamune
GPT-3.5 Turbo をファインチューニングして自分のクローンを作った話
shinbunbun_
1
410
セキュリティキャンプ2023 Y3分散合意ゼミ 最終発表
shinbunbun_
0
5.1k
NixOSでもご自宅k8sがしたい!
shinbunbun_
2
5.2k
カーネルレベルでTwitterを禁止しよう
shinbunbun_
0
330
CRDTで始めるコンフリクトしないデータ同期
shinbunbun_
0
750
Haskell初心者がHaskellの楽しさについて語る
shinbunbun_
0
260
Rustで楕円曲線暗号の署名アルゴリズムをフルスクラッチ実装してみた話
shinbunbun_
0
2.5k
IEEE802.1X認証を導入してみた
shinbunbun_
0
360
UBICの食材管理APIを作った話
shinbunbun_
0
280
Other Decks in Programming
See All in Programming
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
360
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
140
Going Full Circle with Virtual Graphs and Relational Databases
michaelsimons
1
110
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
190
Spec-driven Development with AI
simas
PRO
0
2.3k
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.6k
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
270
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
1
220
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
130
あなたはMCPの機能を、まだ知らない。
4geru
1
740
SODA - FACT BOOK(JP)
sodainc
1
40k
マルチプロダクトSaaSの アプリ一覧を速くする——複数プロダクトにまたがる「権限行脚」を減らすまで #techramen26conf
mktakuya
1
210
Featured
See All Featured
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.7k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
290
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
How STYLIGHT went responsive
nonsquared
100
6.4k
Site-Speed That Sticks
csswizardry
13
1.6k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
From π to Pie charts
rasagy
1
460
Odyssey Design
rkendrick25
PRO
3
970
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.5k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
500
GitHub's CSS Performance
jonrohan
1033
470k