A developer shares early thoughts after one week of working on the view_types feature for Rust (rust-lang/rust#155938). The post explores syntax considerations for view types applied to both immutable and mutable borrows, the possibility of supporting view types for owned values T in addition to &T (enabling partially initialized data and type-checked builder patterns without generic state tracking), challenges around expressing different lifetimes for different fields, and the author's evolving opinion on the proposed syntax. The author notes that extended exposure to a syntax tends to normalize it, drawing a parallel to their experience with let_else.

4m read timeFrom scrabsha.dev
Post cover image
Table of contents
S🦀sha’s blogOne week of view_types
1 Comment

Sort: