Skip to main content

Borrowing

Struct Borrowing 

Source
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, Lb: ?Sized, Rb: ?Sized> Clone for Borrowing<C, Lb, Rb>
where C: Compare<Lb, Rb> + Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C, L, R, Lb: ?Sized, Rb: ?Sized> Compare<L, R> for Borrowing<C, Lb, Rb>
where C: Compare<Lb, Rb>, L: Borrow<Lb> + ?Sized, R: Borrow<Rb> + ?Sized,

Source§

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 compares_lt(&self, l: &L, r: &R) -> bool

Checks if l is less than r.
Source§

fn compares_le(&self, l: &L, r: &R) -> bool

Checks if l is less than or equal to r.
Source§

fn compares_ge(&self, l: &L, r: &R) -> bool

Checks if l is greater than or equal to r.
Source§

fn compares_gt(&self, l: &L, r: &R) -> bool

Checks if l is greater than r.
Source§

fn compares_eq(&self, l: &L, r: &R) -> bool

Checks if l is equal to r.
Source§

fn compares_ne(&self, l: &L, r: &R) -> bool

Checks if l is not equal to r.
Source§

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,

Reverses the ordering of the comparator. Read more
Source§

fn swap(self) -> Swap<Self>
where Self: Sized,

Swaps the comparator’s parameters, maintaining the underlying ordering. Read more
Source§

fn then<D>(self, then: D) -> Then<Self, D>
where D: Compare<L, R>, Self: Sized,

Lexicographically combines the comparator with another. Read more
Source§

impl<C, Lb: ?Sized, Rb: ?Sized> Copy for Borrowing<C, Lb, Rb>
where C: Compare<Lb, Rb> + Copy,

Source§

impl<C, Lb: ?Sized, Rb: ?Sized> Debug for Borrowing<C, Lb, Rb>
where C: Compare<Lb, Rb> + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C, Lb: ?Sized, Rb: ?Sized> Default for Borrowing<C, Lb, Rb>
where C: Compare<Lb, Rb> + Default,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<C, Lb: ?Sized, Rb: ?Sized> Eq for Borrowing<C, Lb, Rb>
where C: Compare<Lb, Rb> + Eq,

Source§

impl<C, Lb: ?Sized, Rb: ?Sized> PartialEq for Borrowing<C, Lb, Rb>
where C: Compare<Lb, Rb> + PartialEq,

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl<C, Lb, Rb> Freeze for Borrowing<C, Lb, Rb>
where C: Freeze, PhantomData<fn(&Lb, &Rb)>: Freeze, Lb: ?Sized, Rb: ?Sized,

§

impl<C, Lb, Rb> RefUnwindSafe for Borrowing<C, Lb, Rb>

§

impl<C, Lb, Rb> Send for Borrowing<C, Lb, Rb>
where C: Send, PhantomData<fn(&Lb, &Rb)>: Send, Lb: ?Sized, Rb: ?Sized,

§

impl<C, Lb, Rb> Sync for Borrowing<C, Lb, Rb>
where C: Sync, PhantomData<fn(&Lb, &Rb)>: Sync, Lb: ?Sized, Rb: ?Sized,

§

impl<C, Lb, Rb> Unpin for Borrowing<C, Lb, Rb>
where C: Unpin, PhantomData<fn(&Lb, &Rb)>: Unpin, Lb: ?Sized, Rb: ?Sized,

§

impl<C, Lb, Rb> UnsafeUnpin for Borrowing<C, Lb, Rb>
where C: UnsafeUnpin, PhantomData<fn(&Lb, &Rb)>: UnsafeUnpin, Lb: ?Sized, Rb: ?Sized,

§

impl<C, Lb, Rb> UnwindSafe for Borrowing<C, Lb, Rb>
where C: UnwindSafe, PhantomData<fn(&Lb, &Rb)>: UnwindSafe, Lb: ?Sized, Rb: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.