Rust · Class
Cow
Rust's Cow is a clone-on-write smart pointer. It reads borrowed data without copying and creates owned data only when mutation or ownership is needed.
Last updated
- Since
- 1.0.0
Syntax
pub enum Cow<'a, B> where B: 'a + ToOwned + ?Sized {
Borrowed(&'a B),
Owned(<B as ToOwned>::Owned),
}In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
BorrowedOwnedToOwnedBorrowDerefRc::make_mutArc::make_mutto_mut