
CommunityNews
Structural typing in Rust
Have you ever wanted to write a structurally typed function in Rust? Do you spend a lot of time and effort getting your Rust
struct
s just so , and want to DRY-out data access for common field paths without declaring a newtrait
and implementing it for each struct (let’s say,Cat
andDog
both have aname: String
field)? If so, read on.
Read in full here:
This thread was posted by one of our members via one of our news source trackers.
Most Liked

OvermindDL1
What this article is talking about isn’t structural typing, it’s nominal row typing. Rust already has a structural type, it’s the Tuple, but the examples and such they show is about a nominal row type. Very bad set of misnaming there… >.>
And yes, row typing is fun, though often not but sometimes can be zero-cost. ^.^
Popular Backend topics










Other popular topics










Latest in Blogs/Talks
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /scala
- /zig
- /html
- /debian
- /nixos
- /lisp
- /agda
- /react-native
- /textmate
- /sublime-text
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /julia
- /c
- /neovim