this post was submitted on 01 Feb 2026
25 points (76.6% liked)

Rust

7718 readers
56 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
 
top 3 comments
sorted by: hot top controversial new old

Rust doesn't have inheritance like in traditional OOP languages because it doesn't have virtual methods. You have to manually implement methods to delegate to base classes.

Also what is this trash meme?

[โ€“] TehPers@beehaw.org 8 points 1 day ago

There is inheritance in Rust. It even comes with the same variance confusion that you find in languages like C# and Java.

[โ€“] calcopiritus@lemmy.world 3 points 1 day ago* (last edited 1 day ago)

Deref works on top of encapsulation though. Inheritance syntactically hides the encapsulation, with Deref it's in the clear.

It's true that it feels like inheritance, but I'm grateful for it. Otherwise it would be a pain to use the windows API.