Module evm::maybe_borrowed

source ·
Expand description

A module containing the MaybeBorrowed enum. See its documentation for details.

Enums

  • Similar to Cow from the standard library, but without requiring T: Clone. Instead of “copy on write”, this data structure represents a type that can create &mut T, either because it is &mut T, or because it is an owned T. This is also distinct from the BorrowMut trait in the standard library because you can have a single collection mix both borrowed and owned data (e.g. let xs: Vec<MaybeBorrowed<'_, T>> = vec![&mut t1, t2] would be possible whereas Vec<B> where B: BorrowMut<T> would need to consist of all owned or all borrowed data).