Raineraineyang.hashnode.dev·Dec 14, 2023Rust Learning Note: Generics and TraitsThis 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...Discusstrait object
emmitt luhningemmitt.hashnode.dev·Jul 22, 2023Building a Rust Dictionary ProgramWhy 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 ...Discuss·72 readsRust
David Carrdcblog.dev·Nov 5, 2022Laravel use multiple boot in traitsLet'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...Discuss·188 readstraits