Loading...
アイコン

developerlife․com

チャンネル登録者数 810人

2007 回視聴 ・ 69いいね ・ 2024/05/29

The Typestate Pattern in Rust is a way to manage objects that go through different states in their lifecycle. It leverages Rust's powerful type system to enforce these states and transitions between them, making your code safer and more predictable. Learn all about it in this article, its video, and repo.

Article: developerlife.com/2024/05/28/typestate-pattern-rus…

For comments and feedback please use these:
Repo: github.com/nazmulidris/rust-scratch/tree/main/type…
Issues: github.com/nazmulidris/rust-scratch/issues

Chapters:
00:00:00 Intro
00:01:00 typestate-pattern in Rust
00:03:00 typed design patterns for the functional era
00:05:00 create a new crate for the live coding video
00:07:00 ex1 model states using enum for InputEvent
00:22:00 ex2 model EditorEvent, and transition InputEvent into EditorEvent
00:34:00 ex3 typestate pattern using structs for HttpResponse
00:58:00 ex3_1 typestate pattern using enums and PhantomData (not structs)

コメント

コメントを取得中...

コントロール
設定

使用したサーバー: hortensia