rust: add associated consts notes

This commit is contained in:
Marcello 2022-09-26 18:40:51 +02:00
parent 62e6ae483d
commit f7ad94f584

View file

@ -665,6 +665,16 @@ s.associated_function(arg); // use struct method
Struct::type_associated_function(arg); Struct::type_associated_function(arg);
``` ```
### Associated Consts
```rs
struct Struct {
const ASSOCIATED_CONST: Type = <value>;
}
Struct::ASSOCIATED_CONST;
```
## Traits ## Traits
A Trait is a collection of methods representing a set of behaviours necessary to accomplish some task. A Trait is a collection of methods representing a set of behaviours necessary to accomplish some task.