gpt4 book ai didi

rust - Rust 中的 "item"是什么?

转载 作者:行者123 更新时间:2023-12-03 11:24:21 24 4
gpt4 key购买 nike

Rust Book多次提到“item”这个词,这赋予了这个词在 Rust 编程语言上下文中的技术含义。例如,参见 Chapter 07-03 :

The way privacy works in Rust is that all items (functions, methods, structs, enums, modules, and constants) are private by default. Items in a parent module can’t use the private items inside child modules, but items in child modules can use the items in their ancestor modules.


什么是项目,是否有 Rust 中所有种类的完整列表?

最佳答案

Items - Rust Reference :

An item is a component of a crate. [...] There are several kinds of items:

  • Modules
  • extern crate declarations
  • use declarations
  • Function definitions
  • Type definitions
  • Struct definitions
  • Enumeration definitions
  • Union definitions
  • Constant items
  • Static items
  • Trait definitions
  • Implementations
  • extern blocks

关于rust - Rust 中的 "item"是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65186555/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com