summaryrefslogtreecommitdiff
path: root/Static class functions are called associated functions.md
blob: dc4c195a38b50f086648f97e936fa337fc95fb42 (plain)
1
2
3
4
5
6
[[Rust]]

---
An `associated function` is what in other OOP languages like PHP would be considered a static function on a class. So it's callable directly from on type rather than an object. An example in Rust is `String::new()`.

It is indicated by the double colon `::`.