Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Coherence, orphan rule » ?

Aussi appelé : coherence (orphan rule)

Definition 8.2 University Computer Science — Year 2 · Chapitre 8 — Traits and Generics

Coherence requires that a program have at most one implementation of a given trait for a given type. Rust enforces it by the orphan rule: a crate may write impl Trait for Type only if the trait or the type is defined in that crate.

Lire dans le chapitre →