Lemmy: Bestiverse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS BotMB to Lobste.rsEnglish · 3 months ago

Conditional Impls

www.possiblerust.com

external-link
message-square
0
link
fedilink
1
external-link

Conditional Impls

www.possiblerust.com

RSS BotMB to Lobste.rsEnglish · 3 months ago
message-square
0
link
fedilink
It’s possible in Rust to conditionally implement methods and traits based on the traits implemented by a type’s own type parameters. While this is used extensively in Rust’s standard library, it’s not necessarily obvious that this is possible. In this article I’ll break down what the pattern is, give some examples of its use in the standard library to show why it’s valuable, and explain when you might want to use it.

Comments

alert-triangle
You must log in or # to comment.

Lobste.rs

lobsters

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !lobsters@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

RSS Feed of lobste.rs

Source of the RSS Bot

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 29 users / day
  • 187 users / week
  • 470 users / month
  • 1.69K users / 6 months
  • 2 local subscribers
  • 379 subscribers
  • 14K Posts
  • 960 Comments
  • Modlog
  • mods:
  • patrick
  • RSS Bot
  • BE: 0.19.15
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org