---
title: "Discussion on \"Rust Learning Note: Generics and Traits\" | Hashnode"
description: "Discussion on \"Rust Learning Note: Generics and Traits\". This blog is a summay of Chapter 2.8 of Rust Course (course.rs)\nGenerics\nGenerics can be used in structs, enumerators, and methods, as shown in the example below:\n1 Using generics in structs:\nstruct Point<T> {\n    x: T,\n    y: T\n}\n\nfn main() {\n    le..."
url: "https://hashnode.com/posts/rust-learning-note-generics-and-traits/657b67765e372fcd6e2eb732"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Rust Learning Note: Generics and Traits](https://raine-yang.com/rust-learning-note-generics-and-traits?utm_source=hashnode&utm_medium=feed)

This blog is a summay of Chapter 2.8 of Rust Course (course.rs) Generics Generics can be used in structs, enumerators, and methods, as shown in the example below: 1 Using generics in structs: struct Point<T> { x: T, y: T } fn main() { le...

Dec 14, 2023 · 7 min read · raine-yang.com  
Read the article

-   [#trait-object](https://hashnode.com/tag/trait-object)
-   [#static-dispatch](https://hashnode.com/tag/static-dispatch)
-   [#dynamic-dispatch](https://hashnode.com/tag/dynamic-dispatch)
-   [#rust](https://hashnode.com/tag/rust)
-   [#generics](https://hashnode.com/tag/generics)
-   [#traits](https://hashnode.com/tag/traits)

## Written by

[Raine](https://hashnode.com/@RaineYang)

@RaineYang

  
[View profile](https://hashnode.com/@RaineYang)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
