<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Traits on Andrew Odendaal</title>
    <link>https://andrewodendaal.com/tags/traits/</link>
    <description>Recent content in Traits on Andrew Odendaal</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 05 Mar 2025 08:00:00 +0400</lastBuildDate>
    <atom:link href="https://andrewodendaal.com/tags/traits/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Traits in Rust: Interfaces with Superpowers</title>
      <link>https://andrewodendaal.com/rust-traits/</link>
      <pubDate>Wed, 05 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-traits/</guid>
      <description>&lt;p&gt;In object-oriented programming, interfaces define a contract that implementing classes must fulfill. Rust&amp;rsquo;s trait system serves a similar purpose but goes far beyond traditional interfaces, offering a powerful mechanism for defining shared behavior, enabling polymorphism, and creating flexible abstractions—all while maintaining Rust&amp;rsquo;s guarantees of memory safety and performance.&lt;/p&gt;&#xA;&lt;p&gt;Traits are one of Rust&amp;rsquo;s most distinctive and powerful features, enabling code reuse without inheritance and polymorphism without runtime overhead. In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s trait system in depth, from basic usage to advanced patterns. You&amp;rsquo;ll learn how to define and implement traits, use trait bounds, work with trait objects, and leverage traits to write generic code that is both flexible and efficient.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
