From 58656c56c4426fdf6fb408c4fdd42dafc9d7aac0 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca <marcello@lamonaca.eu> Date: Mon, 26 Sep 2022 18:40:51 +0200 Subject: [PATCH] rust: add associated consts notes --- docs/rust/rust.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/rust/rust.md b/docs/rust/rust.md index b10f17c..d3cc699 100644 --- a/docs/rust/rust.md +++ b/docs/rust/rust.md @@ -665,6 +665,16 @@ s.associated_function(arg); // use struct method Struct::type_associated_function(arg); ``` +### Associated Consts + +```rs +struct Struct { + const ASSOCIATED_CONST: Type = <value>; +} + +Struct::ASSOCIATED_CONST; +``` + ## Traits A Trait is a collection of methods representing a set of behaviours necessary to accomplish some task.