What is Nostr?
buttercat1791 / Michael J
npub1wqf…qsyn
2025-02-15 03:08:44
in reply to nevent1q…2n7a

buttercat1791 on Nostr: If a struct is like the blueprints of a car, then the blueprints would say it needs ...

If a struct is like the blueprints of a car, then the blueprints would say it needs to have an engine, and they might specify a few kinds of engine it might have. Maybe the car designer isn't an engine designer. He'll tell the engine designer "Go make an engine for this car," and trust the engine designer to do his job.

We'd say the lead designer's blueprint, in this case, is like the struct and its traits—they say that there has to _be_ and engine. The impl is like the engineer who actually designs the engine and makes it fit the vehicle.
Author Public Key
npub1wqfzz2p880wq0tumuae9lfwyhs8uz35xd0kr34zrvrwyh3kvrzuskcqsyn