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 requiringT: 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 ownedT
. This is also distinct from theBorrowMut
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 whereasVec<B> where B: BorrowMut<T>
would need to consist of all owned or all borrowed data).