Re-exported from core::borrow::Borrowed!.
forall T, 'k, 'q.
exposed struct Borrowed! {
cap: Shared!['k, 'q],
ptr: Ref[T, 'k],
}
A Ref[T,'k] together with a shared read capability of its domain, so the value it points to can be compared.
A Ref[T,'k] cannot be hashed or compared on its own (comparing addresses would be pointer identity, not value identity), and Eq only needs to read what it points to, never exclusive access, so the capability fused in is Shared!['k,'q], not Exclusive!['k]. Two Borrowed! values over the same domain but different lineages (the two children of one Shared!::split) can be alive, and compared, at the same time; two Exclusive!['k]-fused values of one domain never could be. Linear because its cap: Shared!['k,'q] field is linear.
Instances
instance Eq[Borrowed![T, 'k, 'q1], Borrowed![T, 'k, 'q2]]source
forall T, 'k, 'q1, 'q2 where Copy[T], Eq[T, T], Sized[T].
instance Eq[Borrowed![T, 'k, 'q1], Borrowed![T, 'k, 'q2]] { ... }
In std::borrow.
Two borrowed references are equal when the values they point to are.