# Structural typing in Rust

**URL:** <https://forum.devtalk.com/t/structural-typing-in-rust/10036>\
**Category:** Blogs/Articles/Talks/Podcasts\
**Tags:** rust, typing\
**Created:** [31 May 2021 01:52 UTC](https://forum.devtalk.com/t/structural-typing-in-rust/10036 "2021-05-31T01:52:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CommunityNews](https://forum.devtalk.com/user_avatar/forum.devtalk.com/communitynews/32/1113_2.png) [@CommunityNews](https://forum.devtalk.com/u/CommunityNews)\
**Post date:** [31 May 2021 01:52 UTC](https://forum.devtalk.com/t/structural-typing-in-rust/10036/1 "2021-05-31T01:52:08Z")

</div>

> 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 new `trait` and implementing it for each struct (let’s say, `Cat` and `Dog` both have a `name: String` field)? If so, read on.

Read in full here:

> **[Structural typing in Rust](https://beachape.com/blog/2021/05/25/structural-typing-in-rust/)**
>
> Bringing structurally typed functions to Rust via LabelledGeneric

_This thread was posted by one of our members via one of our news source trackers._

---

<div class="post-metadata">

**Author:** ![OvermindDL1](https://forum.devtalk.com/user_avatar/forum.devtalk.com/overminddl1/32/52_2.png) [@OvermindDL1](https://forum.devtalk.com/u/OvermindDL1)\
**Post date:** [1 June 2021 15:03 UTC](https://forum.devtalk.com/t/structural-typing-in-rust/10036/3 "2021-06-01T15:03:49Z")

</div>

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. ^.^
