• FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    11 hours ago

    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?

  • calcopiritus@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    12 hours 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.