pub struct Borrowing<C, Lb: ?Sized, Rb: ?Sized = Lb>(/* private fields */)
where
C: Compare<Lb, Rb>;
Expand description
A comparator that borrows its parameters before comparing them.
See Compare::borrow
for an example.
Trait Implementations§
Source§impl<C, L, R, Lb: ?Sized, Rb: ?Sized> Compare<L, R> for Borrowing<C, Lb, Rb>
impl<C, L, R, Lb: ?Sized, Rb: ?Sized> Compare<L, R> for Borrowing<C, Lb, Rb>
Source§fn compare(&self, l: &L, r: &R) -> Ordering
fn compare(&self, l: &L, r: &R) -> Ordering
Compares two values, returning
Less
, Equal
, or Greater
if l
is less
than, equal to, or greater than r
, respectively.Source§fn borrowing(self) -> Borrowing<Self, L, R>where
Self: Sized,
fn borrowing(self) -> Borrowing<Self, L, R>where
Self: Sized,
Borrows the comparator’s parameters before comparing them. Read more
Source§fn rev(self) -> Rev<Self>where
Self: Sized,
fn rev(self) -> Rev<Self>where
Self: Sized,
Reverses the ordering of the comparator. Read more
impl<C, Lb: ?Sized, Rb: ?Sized> Copy for Borrowing<C, Lb, Rb>
impl<C, Lb: ?Sized, Rb: ?Sized> Eq for Borrowing<C, Lb, Rb>
Auto Trait Implementations§
impl<C, Lb, Rb> Freeze for Borrowing<C, Lb, Rb>
impl<C, Lb, Rb> RefUnwindSafe for Borrowing<C, Lb, Rb>
impl<C, Lb, Rb> Send for Borrowing<C, Lb, Rb>
impl<C, Lb, Rb> Sync for Borrowing<C, Lb, Rb>
impl<C, Lb, Rb> Unpin for Borrowing<C, Lb, Rb>
impl<C, Lb, Rb> UnwindSafe for Borrowing<C, Lb, Rb>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more