A borrow is a reference to a value that does not take ownership of it. A shared borrow &x, of type &T, allows reading the value; a mutable, or exclusive, borrow &mut x, of type &mut T, allows changing it. The borrowing rule: at any point of the program, a value has either any number of shared borrows in use, or exactly one exclusive borrow in use, but not both; and no borrow is used after the value is moved or dropped.
书籍暂未推出简体中文版——当前显示英文版。
Computer Science · 术语表
什么是 Borrow?
又称: borrow (Rust)