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§

source

fn borrow_or_share(&'i self) -> &'o T

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.

Implementors§

source§

impl<'i, 'o, T: ?Sized, B> BorrowOrShare<'i, 'o, T> for B
where B: Bos<T> + ?Sized + 'i, B::Ref<'i>: 'o,