Trait borrow_bag::Lookup
source · pub trait Lookup<T, N> { }
Expand description
Allows borrowing a value of type T
from the implementing type. This can be used to constrain
a Handle
argument to ensure it can be used with the corresponding BorrowBag
.
Examples
fn borrow_from<V, T, N>(bag: &BorrowBag<V>, handle: Handle<T, N>) -> &T
where
V: Lookup<T, N>,
{
bag.borrow(handle)
}