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
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.