Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Implementing Traits | Rust Fundamentals lesson | BraveProgrammer
  1. Courses
  2. /
  3. Rust Fundamentals

Lesson 22 of 50

·rust

Implementing Traits

15 minutes

Course progress44%

Implementing Traits

You can implement multiple traits for a type.

use std::fmt;

struct Point {
    x: i32,
    y: i32,
}

impl fmt::Display for Point {
     (&, f: & fmt::Formatter)  fmt:: {
        (f, \
fn
fmt
self
mut
->
Result
write!
"({},{})\", self.x, self.y) } } fn main() { let p = Point { x: 3, y: 4 }; println!(\"Point: {}\", p); }
Make it stickPractice what you've learned1 quiz · 1 practical test · Optional activities from Rust FundamentalsBrowse activities
Previous lessonTraitsContinue to lesson 23GenericsBack to Rust Fundamentals curriculum