Borrow

Trait Borrow 

Source
pub trait Borrow<'a, T>
where T: for<'b> BorrowHkt<'b>,
{ // Required method fn borrow<'b>(&'a self) -> Borrowed<'b, T> where 'a: 'b; }
Expand description

Flexible borrowing trait.

This is similar to std::borrow::Borrow but allows non-reference types to be used.

Required Methods§

Source

fn borrow<'b>(&'a self) -> Borrowed<'b, T>
where 'a: 'b,

Create a borrowed version of this type.

Implementations on Foreign Types§

Source§

impl<'a> Borrow<'a, bool> for bool

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, bool>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, char> for char

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, char>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, f32> for f32

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, f32>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, f64> for f64

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, f64>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, i8> for i8

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, i8>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, i16> for i16

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, i16>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, i32> for i32

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, i32>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, i64> for i64

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, i64>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, i128> for i128

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, i128>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, isize> for isize

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, isize>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, u8> for u8

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, u8>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, u16> for u16

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, u16>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, u32> for u32

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, u32>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, u64> for u64

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, u64>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, u128> for u128

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, u128>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, ()> for ()

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, ()>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, usize> for usize

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, usize>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, BorrowString> for &str

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, BorrowString>
where 'a: 'b,

Source§

impl<'a> Borrow<'a, BorrowString> for String

Source§

fn borrow<'b>(&'a self) -> Borrowed<'b, BorrowString>
where 'a: 'b,

Implementors§

Source§

impl<'a, T> Borrow<'a, BorrowCow<T>> for Cow<'a, T>
where T: Cowable, CowableBorrowed<'a, T>: Borrow<'a, T::BorrowHkt>, CowableOwned<T>: Borrow<'a, T::BorrowHkt>,