From f7ad94f584c95353f050db289ea5ef53ef4eab59 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca 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 = ; +} + +Struct::ASSOCIATED_CONST; +``` + ## Traits A Trait is a collection of methods representing a set of behaviours necessary to accomplish some task.