CommunityNews

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 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:

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

Most Liked

OvermindDL1

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

Where Next?

Popular Backend topics Top

dimitarvp
Apparently he decided to live-stream how he’s going to create a semver library.
New
New
First poster: bot
When I need to configure something in a complicated way, I find myself reviewing the embedded language that provided the server to create...
New
First poster: bot
Rails Best Practices I. Today I share some of my favorite practices applicable to Ruby on Rails (and to web development on small teams g...
New
paulanthonywilson
Post on using UDP multicasting with Elixir to broadcast presence, and listen for peers, on a local network. I have found this approach us...
New
CommunityNews
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 jus...
New
New
pablocostass
Todos coñecemos os focos de Erlang/Elixir máis renomeados do mundo, como a Suecia, o Brasil, a California ou Londres. Mais a comunidade, ...
New
brainlid
In episode 83 of Thinking Elixir, We talk with Isaac Yonemoto about the Zig language and his Zigler Elixir library. We learn where Zig ca...
New
fullstackplus
The Ruby ecosystem is rich with tools that make us developers more productive at what we do. Both Rails and Sinatra have been used to bui...
New

Other popular topics Top

malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
AstonJ
Or looking forward to? :nerd_face:
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New