pub enum Is<'a, T>{
Owned(T::Owned),
Borrowed(&'a T),
MutBorrowed(&'a mut T),
}Expand description
Represents an owned, immutably borrowed, or mutably borrowed data.
Variants§
Owned(T::Owned)
Owned data.
Borrowed(&'a T)
Immutably borrowed data.
MutBorrowed(&'a mut T)
Mutably borrowed data.
Trait Implementations§
Source§impl<T, U, O> Add<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefAdd<Owned<U>, Output = O> + for<'a> RefAdd<&'a U::Is, Output = O> + for<'a> RefAdd<&'a mut U::Is, Output = O> + RefMutAdd<Owned<U>, Output = O> + for<'a> RefMutAdd<&'a U::Is, Output = O> + for<'a> RefMutAdd<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Add<Owned<U>, Output = O> + for<'a> Add<&'a U::Is, Output = O> + for<'a> Add<&'a mut U::Is, Output = O>,
impl<T, U, O> Add<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefAdd<Owned<U>, Output = O> + for<'a> RefAdd<&'a U::Is, Output = O> + for<'a> RefAdd<&'a mut U::Is, Output = O> + RefMutAdd<Owned<U>, Output = O> + for<'a> RefMutAdd<&'a U::Is, Output = O> + for<'a> RefMutAdd<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Add<Owned<U>, Output = O> + for<'a> Add<&'a U::Is, Output = O> + for<'a> Add<&'a mut U::Is, Output = O>,
Source§impl<T> AsIs for Is<'_, T>
impl<T> AsIs for Is<'_, T>
Source§fn as_is<'a>(self) -> Is<'a, T>where
Self: 'a,
fn as_is<'a>(self) -> Is<'a, T>where
Self: 'a,
Converts
self into an Is<'a, Self::Is>.Source§fn into_is_cow<'a, B>(self) -> IsCow<'a, B>
fn into_is_cow<'a, B>(self) -> IsCow<'a, B>
Converts
self into an IsCow<'a, B>.Source§impl<T, U, O> BitAnd<U> for &mut Is<'_, T>where
T: ?Sized + ToOwnedMut + RefBitAnd<Owned<U>, Output = O> + for<'a> RefBitAnd<&'a U::Is, Output = O> + for<'a> RefBitAnd<&'a mut U::Is, Output = O> + RefMutBitAnd<Owned<U>, Output = O> + for<'a> RefMutBitAnd<&'a U::Is, Output = O> + for<'a> RefMutBitAnd<&'a mut U::Is, Output = O>,
U: AsIs,
impl<T, U, O> BitAnd<U> for &mut Is<'_, T>where
T: ?Sized + ToOwnedMut + RefBitAnd<Owned<U>, Output = O> + for<'a> RefBitAnd<&'a U::Is, Output = O> + for<'a> RefBitAnd<&'a mut U::Is, Output = O> + RefMutBitAnd<Owned<U>, Output = O> + for<'a> RefMutBitAnd<&'a U::Is, Output = O> + for<'a> RefMutBitAnd<&'a mut U::Is, Output = O>,
U: AsIs,
Source§impl<T, U, O> BitAnd<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefBitAnd<Owned<U>, Output = O> + for<'a> RefBitAnd<&'a U::Is, Output = O> + for<'a> RefBitAnd<&'a mut U::Is, Output = O> + RefMutBitAnd<Owned<U>, Output = O> + for<'a> RefMutBitAnd<&'a U::Is, Output = O> + for<'a> RefMutBitAnd<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: BitAnd<Owned<U>, Output = O> + for<'a> BitAnd<&'a U::Is, Output = O> + for<'a> BitAnd<&'a mut U::Is, Output = O>,
impl<T, U, O> BitAnd<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefBitAnd<Owned<U>, Output = O> + for<'a> RefBitAnd<&'a U::Is, Output = O> + for<'a> RefBitAnd<&'a mut U::Is, Output = O> + RefMutBitAnd<Owned<U>, Output = O> + for<'a> RefMutBitAnd<&'a U::Is, Output = O> + for<'a> RefMutBitAnd<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: BitAnd<Owned<U>, Output = O> + for<'a> BitAnd<&'a U::Is, Output = O> + for<'a> BitAnd<&'a mut U::Is, Output = O>,
Source§impl<T, U, O> BitOr<U> for &mut Is<'_, T>where
T: ?Sized + ToOwnedMut + RefBitOr<Owned<U>, Output = O> + for<'a> RefBitOr<&'a U::Is, Output = O> + for<'a> RefBitOr<&'a mut U::Is, Output = O> + RefMutBitOr<Owned<U>, Output = O> + for<'a> RefMutBitOr<&'a U::Is, Output = O> + for<'a> RefMutBitOr<&'a mut U::Is, Output = O>,
U: AsIs,
impl<T, U, O> BitOr<U> for &mut Is<'_, T>where
T: ?Sized + ToOwnedMut + RefBitOr<Owned<U>, Output = O> + for<'a> RefBitOr<&'a U::Is, Output = O> + for<'a> RefBitOr<&'a mut U::Is, Output = O> + RefMutBitOr<Owned<U>, Output = O> + for<'a> RefMutBitOr<&'a U::Is, Output = O> + for<'a> RefMutBitOr<&'a mut U::Is, Output = O>,
U: AsIs,
Source§impl<T, U, O> BitOr<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefBitOr<Owned<U>, Output = O> + for<'a> RefBitOr<&'a U::Is, Output = O> + for<'a> RefBitOr<&'a mut U::Is, Output = O> + RefMutBitOr<Owned<U>, Output = O> + for<'a> RefMutBitOr<&'a U::Is, Output = O> + for<'a> RefMutBitOr<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: BitOr<Owned<U>, Output = O> + for<'a> BitOr<&'a U::Is, Output = O> + for<'a> BitOr<&'a mut U::Is, Output = O>,
impl<T, U, O> BitOr<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefBitOr<Owned<U>, Output = O> + for<'a> RefBitOr<&'a U::Is, Output = O> + for<'a> RefBitOr<&'a mut U::Is, Output = O> + RefMutBitOr<Owned<U>, Output = O> + for<'a> RefMutBitOr<&'a U::Is, Output = O> + for<'a> RefMutBitOr<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: BitOr<Owned<U>, Output = O> + for<'a> BitOr<&'a U::Is, Output = O> + for<'a> BitOr<&'a mut U::Is, Output = O>,
Source§impl<T, U, O> BitXor<U> for &mut Is<'_, T>where
T: ?Sized + ToOwnedMut + RefBitXor<Owned<U>, Output = O> + for<'a> RefBitXor<&'a U::Is, Output = O> + for<'a> RefBitXor<&'a mut U::Is, Output = O> + RefMutBitXor<Owned<U>, Output = O> + for<'a> RefMutBitXor<&'a U::Is, Output = O> + for<'a> RefMutBitXor<&'a mut U::Is, Output = O>,
U: AsIs,
impl<T, U, O> BitXor<U> for &mut Is<'_, T>where
T: ?Sized + ToOwnedMut + RefBitXor<Owned<U>, Output = O> + for<'a> RefBitXor<&'a U::Is, Output = O> + for<'a> RefBitXor<&'a mut U::Is, Output = O> + RefMutBitXor<Owned<U>, Output = O> + for<'a> RefMutBitXor<&'a U::Is, Output = O> + for<'a> RefMutBitXor<&'a mut U::Is, Output = O>,
U: AsIs,
Source§impl<T, U, O> BitXor<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefBitXor<Owned<U>, Output = O> + for<'a> RefBitXor<&'a U::Is, Output = O> + for<'a> RefBitXor<&'a mut U::Is, Output = O> + RefMutBitXor<Owned<U>, Output = O> + for<'a> RefMutBitXor<&'a U::Is, Output = O> + for<'a> RefMutBitXor<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: BitXor<Owned<U>, Output = O> + for<'a> BitXor<&'a U::Is, Output = O> + for<'a> BitXor<&'a mut U::Is, Output = O>,
impl<T, U, O> BitXor<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefBitXor<Owned<U>, Output = O> + for<'a> RefBitXor<&'a U::Is, Output = O> + for<'a> RefBitXor<&'a mut U::Is, Output = O> + RefMutBitXor<Owned<U>, Output = O> + for<'a> RefMutBitXor<&'a U::Is, Output = O> + for<'a> RefMutBitXor<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: BitXor<Owned<U>, Output = O> + for<'a> BitXor<&'a U::Is, Output = O> + for<'a> BitXor<&'a mut U::Is, Output = O>,
Source§impl<T> BorrowAsIs for Is<'_, T>
impl<T> BorrowAsIs for Is<'_, T>
Source§fn borrow_or_clone<B>(&self) -> IsCow<'_, B>
fn borrow_or_clone<B>(&self) -> IsCow<'_, B>
Immutably borrows from
self by default, but can be overridden to clone self if
appropriate.Source§fn borrow_as_is(&self) -> &Self::Is
fn borrow_as_is(&self) -> &Self::Is
Immutably borrows from
self as Is.Source§impl<T, U, O> Div<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefDiv<Owned<U>, Output = O> + for<'a> RefDiv<&'a U::Is, Output = O> + for<'a> RefDiv<&'a mut U::Is, Output = O> + RefMutDiv<Owned<U>, Output = O> + for<'a> RefMutDiv<&'a U::Is, Output = O> + for<'a> RefMutDiv<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Div<Owned<U>, Output = O> + for<'a> Div<&'a U::Is, Output = O> + for<'a> Div<&'a mut U::Is, Output = O>,
impl<T, U, O> Div<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefDiv<Owned<U>, Output = O> + for<'a> RefDiv<&'a U::Is, Output = O> + for<'a> RefDiv<&'a mut U::Is, Output = O> + RefMutDiv<Owned<U>, Output = O> + for<'a> RefMutDiv<&'a U::Is, Output = O> + for<'a> RefMutDiv<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Div<Owned<U>, Output = O> + for<'a> Div<&'a U::Is, Output = O> + for<'a> Div<&'a mut U::Is, Output = O>,
Source§impl<T, U, O> Mul<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefMul<Owned<U>, Output = O> + for<'a> RefMul<&'a U::Is, Output = O> + for<'a> RefMul<&'a mut U::Is, Output = O> + RefMutMul<Owned<U>, Output = O> + for<'a> RefMutMul<&'a U::Is, Output = O> + for<'a> RefMutMul<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Mul<Owned<U>, Output = O> + for<'a> Mul<&'a U::Is, Output = O> + for<'a> Mul<&'a mut U::Is, Output = O>,
impl<T, U, O> Mul<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefMul<Owned<U>, Output = O> + for<'a> RefMul<&'a U::Is, Output = O> + for<'a> RefMul<&'a mut U::Is, Output = O> + RefMutMul<Owned<U>, Output = O> + for<'a> RefMutMul<&'a U::Is, Output = O> + for<'a> RefMutMul<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Mul<Owned<U>, Output = O> + for<'a> Mul<&'a U::Is, Output = O> + for<'a> Mul<&'a mut U::Is, Output = O>,
Source§impl<T> Ord for Is<'_, T>
impl<T> Ord for Is<'_, T>
Source§impl<T, U> PartialOrd<Is<'_, U>> for Is<'_, T>
impl<T, U> PartialOrd<Is<'_, U>> for Is<'_, T>
Source§impl<T, U> PartialOrd<Is<'_, U>> for IsCow<'_, T>
impl<T, U> PartialOrd<Is<'_, U>> for IsCow<'_, T>
Source§impl<T, U> PartialOrd<Is<'_, U>> for IsMut<'_, T>
impl<T, U> PartialOrd<Is<'_, U>> for IsMut<'_, T>
Source§impl<T, U> PartialOrd<IsCow<'_, U>> for Is<'_, T>
impl<T, U> PartialOrd<IsCow<'_, U>> for Is<'_, T>
Source§impl<T, U> PartialOrd<IsMut<'_, U>> for Is<'_, T>
impl<T, U> PartialOrd<IsMut<'_, U>> for Is<'_, T>
Source§impl<T, U, O> Rem<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefRem<Owned<U>, Output = O> + for<'a> RefRem<&'a U::Is, Output = O> + for<'a> RefRem<&'a mut U::Is, Output = O> + RefMutRem<Owned<U>, Output = O> + for<'a> RefMutRem<&'a U::Is, Output = O> + for<'a> RefMutRem<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Rem<Owned<U>, Output = O> + for<'a> Rem<&'a U::Is, Output = O> + for<'a> Rem<&'a mut U::Is, Output = O>,
impl<T, U, O> Rem<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefRem<Owned<U>, Output = O> + for<'a> RefRem<&'a U::Is, Output = O> + for<'a> RefRem<&'a mut U::Is, Output = O> + RefMutRem<Owned<U>, Output = O> + for<'a> RefMutRem<&'a U::Is, Output = O> + for<'a> RefMutRem<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Rem<Owned<U>, Output = O> + for<'a> Rem<&'a U::Is, Output = O> + for<'a> Rem<&'a mut U::Is, Output = O>,
Source§impl<T, U, O> Shl<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefShl<Owned<U>, Output = O> + for<'a> RefShl<&'a U::Is, Output = O> + for<'a> RefShl<&'a mut U::Is, Output = O> + RefMutShl<Owned<U>, Output = O> + for<'a> RefMutShl<&'a U::Is, Output = O> + for<'a> RefMutShl<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Shl<Owned<U>, Output = O> + for<'a> Shl<&'a U::Is, Output = O> + for<'a> Shl<&'a mut U::Is, Output = O>,
impl<T, U, O> Shl<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefShl<Owned<U>, Output = O> + for<'a> RefShl<&'a U::Is, Output = O> + for<'a> RefShl<&'a mut U::Is, Output = O> + RefMutShl<Owned<U>, Output = O> + for<'a> RefMutShl<&'a U::Is, Output = O> + for<'a> RefMutShl<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Shl<Owned<U>, Output = O> + for<'a> Shl<&'a U::Is, Output = O> + for<'a> Shl<&'a mut U::Is, Output = O>,
Source§impl<T, U, O> Shr<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefShr<Owned<U>, Output = O> + for<'a> RefShr<&'a U::Is, Output = O> + for<'a> RefShr<&'a mut U::Is, Output = O> + RefMutShr<Owned<U>, Output = O> + for<'a> RefMutShr<&'a U::Is, Output = O> + for<'a> RefMutShr<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Shr<Owned<U>, Output = O> + for<'a> Shr<&'a U::Is, Output = O> + for<'a> Shr<&'a mut U::Is, Output = O>,
impl<T, U, O> Shr<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefShr<Owned<U>, Output = O> + for<'a> RefShr<&'a U::Is, Output = O> + for<'a> RefShr<&'a mut U::Is, Output = O> + RefMutShr<Owned<U>, Output = O> + for<'a> RefMutShr<&'a U::Is, Output = O> + for<'a> RefMutShr<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Shr<Owned<U>, Output = O> + for<'a> Shr<&'a U::Is, Output = O> + for<'a> Shr<&'a mut U::Is, Output = O>,
Source§impl<T, U, O> Sub<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefSub<Owned<U>, Output = O> + for<'a> RefSub<&'a U::Is, Output = O> + for<'a> RefSub<&'a mut U::Is, Output = O> + RefMutSub<Owned<U>, Output = O> + for<'a> RefMutSub<&'a U::Is, Output = O> + for<'a> RefMutSub<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Sub<Owned<U>, Output = O> + for<'a> Sub<&'a U::Is, Output = O> + for<'a> Sub<&'a mut U::Is, Output = O>,
impl<T, U, O> Sub<U> for Is<'_, T>where
T: ?Sized + ToOwned + RefSub<Owned<U>, Output = O> + for<'a> RefSub<&'a U::Is, Output = O> + for<'a> RefSub<&'a mut U::Is, Output = O> + RefMutSub<Owned<U>, Output = O> + for<'a> RefMutSub<&'a U::Is, Output = O> + for<'a> RefMutSub<&'a mut U::Is, Output = O>,
U: AsIs,
T::Owned: Sub<Owned<U>, Output = O> + for<'a> Sub<&'a U::Is, Output = O> + for<'a> Sub<&'a mut U::Is, Output = O>,
impl<T> Eq for Is<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Is<'a, T>
impl<'a, T> RefUnwindSafe for Is<'a, T>
impl<'a, T> Send for Is<'a, T>
impl<'a, T> Sync for Is<'a, T>
impl<'a, T> Unpin for Is<'a, T>
impl<'a, T> !UnwindSafe for Is<'a, T>
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