1 Star 0 Fork 1

linux内核和设计研究/rust-by-example

forked from alanding/rust-by-example 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
attribute.md 1.08 KB
一键复制 编辑 原始数据 按行查看 历史

Attributes

An attribute is metadata applied to some module, crate or item. This metadata can be used to/for:

When attributes apply to a whole crate, their syntax is #![crate_attribute], and when they apply to a module or item, the syntax is #[item_attribute] (notice the missing bang !).

Attributes can take arguments with different syntaxes:

  • #[attribute = "value"]
  • #[attribute(key = "value")]
  • #[attribute(value)]

Attributes can have multiple values and can be separated over multiple lines, too:

#[attribute(value, value2)]


#[attribute(value, value2, value3,
            value4, value5)]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/rustlangbase/rust-by-example.git
git@gitee.com:rustlangbase/rust-by-example.git
rustlangbase
rust-by-example
rust-by-example
master

搜索帮助