全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Copy type?

又称: copy type (Rust)

Definition 6.4 University Computer Science — Year 2 · 第 6 章 — Rust: Ownership and Borrowing

A copy type is a type whose values are duplicated by copying their bytes, with no resource to free, and that implements the Copy trait: the integers, f64, bool, char, shared references, and tuples and arrays of copy types. For a copy type, assignment and passing by value copy, and the source stays usable. A type that owns a resource, such as String or Vec, cannot be Copy.

在原文中阅读 →