Trait borrow_or_share::BorrowOrShare
source · pub trait BorrowOrShare<'i, 'o, T: ?Sized>: Bos<T> {
// Required method
fn borrow_or_share(&'i self) -> &'o T;
}
Expand description
A helper trait for writing “data borrowing or sharing” functions.
See the crate-level documentation for more details.
Required Methods§
Borrows from *self
or from behind a reference it holds.
In the latter case, the returned reference is said to be shared with *self
.
Object Safety§
This trait is not object safe.