softwaremill.com

Adapter Pattern in Rust: Overcoming the Orphan Rule with Newtype and Extension Traits (opens in new tab)

Some time ago, we were talking about the Newtype pattern in the Rust programming language. For that pattern, we used a single-field tuple struct to either alter the inner type semantics or to hide the implementation type from the end user - often we wanted both. This time, we will also take a closer look into the single-field tuple struct, this tim...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help