IT lexicon › Programming › Trait

Trait

Programming På svenska → Updated: 2026-05-23

Rust's term for "interface" — describes which methods a type implements.

Also in Scala, Swift, PHP. Different from a classic Java interface: traits can have default implementations and be composed. Rust's trait system + ownership give polymorphism without runtime overhead.

← Back to the lexicon