---
source: https://iinventedlight.com/library/notes/rust-associated-types.md
title: "Associated types: placeholders on a trait"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT OR Apache-2.0 (The Rust Programming Language); MIT OR Apache-2.0 (Rust by Example); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: The Rust Programming Language, Advanced Traits; Rust by Example, Associated types. MIT OR Apache-2.0 (https://raw.githubusercontent.com/rust-lang/book/main/LICENSE-MIT). Copyright the Rust Project Developers. MIT OR Apache-2.0 (https://raw.githubusercontent.com/rust-lang/rust-by-example/master/LICENSE-MIT). Copyright the Rust Project Developers."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: rust-associated-types"
tags: [rust, traits, associated-types, generics]
client: Librarian
sources:
  - id: S1
    title: "Advanced Traits"
    publisher: The Rust Programming Language
    url: https://doc.rust-lang.org/book/ch20-02-advanced-traits.html
    accessed: 2026-11-23
    license: "MIT OR Apache-2.0"
  - id: S2
    title: "Associated types"
    publisher: Rust by Example
    url: https://doc.rust-lang.org/rust-by-example/generics/assoc_items/types.html
    accessed: 2026-11-23
    license: "MIT OR Apache-2.0"
---
# Associated types: placeholders on a trait
**Answer:** An associated type puts a type placeholder on a trait. Each implementor names the concrete type, and method signatures can mention that placeholder.

## In the Rust book

The book says associated types connect a type placeholder with a trait.

Trait method definitions can then use these placeholder types inside their signatures.

Implementors supply the concrete type when they implement the trait.

## Readability in Rust by Example

Rust by Example says this feature improves overall readability by moving inner types into the trait as output types.

Without using associated types, a function may still have to express A or B.

Using associated types, a function is no longer required to express A or B at all.

## See also

- [rust-traits](https://iinventedlight.com/library/notes/rust-traits/)
- [rust-impl-trait](https://iinventedlight.com/library/notes/rust-impl-trait/)

## Claims

- id: C1
  claim: Associated types connect a type placeholder with a trait.
  source: S1
  evidence: "Associated types connect a type placeholder with a trait"

- id: C2
  claim: Method definitions can use those placeholder types in their signatures.
  source: S1
  evidence: "placeholder types in their signatures"

- id: C3
  claim: Associated types move inner types locally into a trait as output types.
  source: S2
  evidence: "moving inner types locally into a trait as output types"

- id: C4
  claim: That move improves the overall readability of code.
  source: S2
  evidence: "improves the overall readability of code"

## Sources

- [S1] Advanced Traits. The Rust Programming Language. https://doc.rust-lang.org/book/ch20-02-advanced-traits.html . License: MIT OR Apache-2.0. Accessed 2026-11-23.

- [S2] Associated types. Rust by Example. https://doc.rust-lang.org/rust-by-example/generics/assoc_items/types.html . License: MIT OR Apache-2.0. Accessed 2026-11-23.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Rust Programming Language, Advanced Traits; Rust by Example, Associated types. MIT OR Apache-2.0 (https://raw.githubusercontent.com/rust-lang/book/main/LICENSE-MIT). Copyright the Rust Project Developers. MIT OR Apache-2.0 (https://raw.githubusercontent.com/rust-lang/rust-by-example/master/LICENSE-MIT). Copyright the Rust Project Developers. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
