---
title: "#traits articles | Hashnode"
description: "Explore 10 articles tagged #traits on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/traits"
---

Tag

# #traits

10 posts · 0 followers

[Kendrick Olori](https://hashnode.com/@olorikendrick) · [Jun 6](https://hashnode.com/posts/introduction-to-traits-in-rust/6a245d58d58fd40c3a48fb92)

### [Introduction to Traits in Rust](https://kendrickolori.hashnode.dev/introduction-to-traits-in-rust?utm_source=hashnode&utm_medium=feed)

Learn how Rust traits work in practice — Default, Clone, PartialEq, Serde, and more, through a real hands-on example.

7 min read · [kendrickolori.hashnode.dev](https://kendrickolori.hashnode.dev/introduction-to-traits-in-rust?utm_source=hashnode&utm_medium=feed)

[Muhammad Yafi Alhakim](https://hashnode.com/@yafialhakim) · [Apr 7](https://hashnode.com/posts/traits-the-contract-system/69d4e01da565305bb4c0aa8f)

### [Traits: The "Contract" System](https://yafi.hashnode.dev/traits-the-contract-system?utm_source=hashnode&utm_medium=feed)

ABSTRACT: 🧩 Analogy for Frontend Developers A Trait in Rust is exactly like an interface in TypeScript. Think of a Trait as a Contract or a Job Description. It is a way to define shared behavior in an abstract way, forcing different types of data t...

4 min read · [yafi.hashnode.dev](https://yafi.hashnode.dev/traits-the-contract-system?utm_source=hashnode&utm_medium=feed)

[Nishil Bhave](https://hashnode.com/@nishilbhave) · [Mar 28](https://hashnode.com/posts/php-traits-vs-abstract-classes-vs-interfaces-when-to-use-each/69c768359ffb7927e5cbebbb)

### [PHP Traits vs Abstract Classes vs Interfaces: When to Use Each](https://nishilbhave.hashnode.dev/php-traits-vs-abstract-classes-vs-interfaces-when-to-use-each?utm_source=hashnode&utm_medium=feed)

PHP Traits vs Abstract Classes vs Interfaces: When to Use Each PHP's OOP system gives you three tools for sharing behavior -- traits, abstract classes, and interfaces -- but each one solves a fundamentally different problem. Picking the wrong one lea...

19 min read · [nishilbhave.hashnode.dev](https://nishilbhave.hashnode.dev/php-traits-vs-abstract-classes-vs-interfaces-when-to-use-each?utm_source=hashnode&utm_medium=feed)

[Sohag Hasan](https://hashnode.com/@sohag) · [Oct 31, 2024](https://hashnode.com/posts/demystifying-php-traits-your-comprehensive-guide-to-code-reusability/67239d308398cac7d77ab5d8)

### [Demystifying PHP Traits: Your Comprehensive Guide to Code Reusability](https://notes.sohag.pro/demystifying-php-traits-your-comprehensive-guide-to-code-reusability?utm_source=hashnode&utm_medium=feed)

PHP Traits What are Traits in PHP? Imagine you're building a house, and instead of constructing everything from scratch, you could simply pick up pre-made modules and attach them wherever you need. In PHP, Traits are exactly like these modular buildi...

3 min read · [notes.sohag.pro](https://notes.sohag.pro/demystifying-php-traits-your-comprehensive-guide-to-code-reusability?utm_source=hashnode&utm_medium=feed)

[SOUMITRA-SAHA](https://hashnode.com/@SoumitraSaha) · [May 28, 2024](https://hashnode.com/posts/generics-and-traits-in-rust/66655805b3f22c173ab25b05)

### [Generics and Traits in Rust: A Friendly Guide](https://ssblogs.hashnode.dev/generics-and-traits-in-rust?utm_source=hashnode&utm_medium=feed)

"Master Rust with practical examples! Explore Generic Types & Traits. Boost your coding skills today. #RustProgramming #LearnToCode"

9 min read · [ssblogs.hashnode.dev](https://ssblogs.hashnode.dev/generics-and-traits-in-rust?utm_source=hashnode&utm_medium=feed)

[Rahul Gupta](https://hashnode.com/@therahulgupta) · [May 17, 2024](https://hashnode.com/posts/laravel-11-new-artisan-maketrait-command/66477c4037e87dc851a659c3)

### [Laravel 11: New Artisan "make:trait" Command](https://therahul-gupta.hashnode.dev/laravel-11-new-artisan-maketrait-command?utm_source=hashnode&utm_medium=feed)

Discover Laravel 11's new Artisan "make:trait" command for streamlined trait creation, enhancing efficiency and code reusability in your projects

3 min read · [therahul-gupta.hashnode.dev](https://therahul-gupta.hashnode.dev/laravel-11-new-artisan-maketrait-command?utm_source=hashnode&utm_medium=feed)

[Raine](https://hashnode.com/@RaineYang) · [Dec 14, 2023](https://hashnode.com/posts/rust-learning-note-generics-and-traits/657b67765e372fcd6e2eb732)

### [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...

7 min read · [raine-yang.com](https://raine-yang.com/rust-learning-note-generics-and-traits?utm_source=hashnode&utm_medium=feed)

[emmitt luhning](https://hashnode.com/@emmitt) · [Jul 22, 2023](https://hashnode.com/posts/building-a-rust-dictionary-program/64bb454b91bc734c1f8ddb5c)

### [Building a Rust Dictionary Program](https://emmitt.hashnode.dev/building-a-rust-dictionary-program?utm_source=hashnode&utm_medium=feed)

Why Rust? I've casually had my eye on Rust for quite a bit now. A couple of years ago I joined a hackathon leveraging some Web3 technologies at the height of the crypto hype, and learned about smart contracts. At the time, the chain we were building ...

13 min read · [emmitt.hashnode.dev](https://emmitt.hashnode.dev/building-a-rust-dictionary-program?utm_source=hashnode&utm_medium=feed)

[David Carr](https://hashnode.com/@dcblogdev) · [Nov 5, 2022](https://hashnode.com/posts/laravel-use-multiple-boot-in-traits/636d0353bda63b7117075525)

### [Laravel use multiple boot in traits](https://dcblog.dev/laravel-use-multiple-boot-in-traits?utm_source=hashnode&utm_medium=feed)

Let's say you want to use multiple traits in your models to reuse common code such as applying UUIDs and settings global query scopes like this: use HasUuid; use HasTenant; Each of these traits has a boot method: HasUuid: trait HasUuid { public f...

2 min read · [dcblog.dev](https://dcblog.dev/laravel-use-multiple-boot-in-traits?utm_source=hashnode&utm_medium=feed)
