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
sourceimpl<T: ?Sized + ToOwned, U: AsIs, O> Add<U> for Is<'_, T>where
    for<'a> T::Owned: Add<Owned<U>, Output = O> + Add<&'a Owned<U>, Output = O> + Add<&'a U::Is, Output = O>,
    for<'a> T: RefAdd<Owned<U>, Output = O> + RefAdd<&'a Owned<U>, Output = O> + RefAdd<&'a U::Is, Output = O>,
 
impl<T: ?Sized + ToOwned, U: AsIs, O> Add<U> for Is<'_, T>where
    for<'a> T::Owned: Add<Owned<U>, Output = O> + Add<&'a Owned<U>, Output = O> + Add<&'a U::Is, Output = O>,
    for<'a> T: RefAdd<Owned<U>, Output = O> + RefAdd<&'a Owned<U>, Output = O> + RefAdd<&'a U::Is, Output = O>,
sourceimpl<T: ?Sized + ToOwned> AsIs for Is<'_, T>
 
impl<T: ?Sized + ToOwned> AsIs for Is<'_, T>
type Is = T
type Is = T
The base type associated with both owned and borrowed data.
sourcefn borrow_or_clone<B: ?Sized>(&self) -> IsCow<'_, B>where
    T: Borrow<B>,
    T::Owned: Borrow<B>,
    B: ToOwned<Owned = T::Owned>,
 
fn borrow_or_clone<B: ?Sized>(&self) -> IsCow<'_, B>where
    T: Borrow<B>,
    T::Owned: Borrow<B>,
    B: ToOwned<Owned = T::Owned>,
Immutably borrows from 
self by default, but can be overridden to clone self if
appropriate. Read moresourcefn into_is<'a, B: ?Sized>(self) -> Is<'a, B>where
    Self: 'a,
    Self::Is: BorrowMut<B>,
    B: ToOwned<Owned = Owned<Self>>,
 
fn into_is<'a, B: ?Sized>(self) -> Is<'a, B>where
    Self: 'a,
    Self::Is: BorrowMut<B>,
    B: ToOwned<Owned = Owned<Self>>,
sourcefn into_is_cow<'a, B: ?Sized>(self) -> IsCow<'a, B>where
    Self: 'a,
    Self::Is: Borrow<B>,
    B: ToOwned<Owned = Owned<Self>>,
 
fn into_is_cow<'a, B: ?Sized>(self) -> IsCow<'a, B>where
    Self: 'a,
    Self::Is: Borrow<B>,
    B: ToOwned<Owned = Owned<Self>>,
sourcefn try_into_is_mut<'a, B: ?Sized>(
    self
) -> Result<IsMut<'a, B>, Is<'a, Self::Is>>where
    Self: 'a,
    Self::Is: BorrowMut<B>,
    B: ToOwned<Owned = Owned<Self>>,
 
fn try_into_is_mut<'a, B: ?Sized>(
    self
) -> Result<IsMut<'a, B>, Is<'a, Self::Is>>where
    Self: 'a,
    Self::Is: BorrowMut<B>,
    B: ToOwned<Owned = Owned<Self>>,
sourceimpl<T: ?Sized + ToOwned, U: AsIs, O> BitAnd<U> for Is<'_, T>where
    for<'a> T::Owned: BitAnd<Owned<U>, Output = O> + BitAnd<&'a Owned<U>, Output = O> + BitAnd<&'a U::Is, Output = O>,
    for<'a> T: RefBitAnd<Owned<U>, Output = O> + RefBitAnd<&'a Owned<U>, Output = O> + RefBitAnd<&'a U::Is, Output = O>,
 
impl<T: ?Sized + ToOwned, U: AsIs, O> BitAnd<U> for Is<'_, T>where
    for<'a> T::Owned: BitAnd<Owned<U>, Output = O> + BitAnd<&'a Owned<U>, Output = O> + BitAnd<&'a U::Is, Output = O>,
    for<'a> T: RefBitAnd<Owned<U>, Output = O> + RefBitAnd<&'a Owned<U>, Output = O> + RefBitAnd<&'a U::Is, Output = O>,
sourceimpl<T: ?Sized + ToOwned, U: AsIs, O> BitOr<U> for Is<'_, T>where
    for<'a> T::Owned: BitOr<Owned<U>, Output = O> + BitOr<&'a Owned<U>, Output = O> + BitOr<&'a U::Is, Output = O>,
    for<'a> T: RefBitOr<Owned<U>, Output = O> + RefBitOr<&'a Owned<U>, Output = O> + RefBitOr<&'a U::Is, Output = O>,
 
impl<T: ?Sized + ToOwned, U: AsIs, O> BitOr<U> for Is<'_, T>where
    for<'a> T::Owned: BitOr<Owned<U>, Output = O> + BitOr<&'a Owned<U>, Output = O> + BitOr<&'a U::Is, Output = O>,
    for<'a> T: RefBitOr<Owned<U>, Output = O> + RefBitOr<&'a Owned<U>, Output = O> + RefBitOr<&'a U::Is, Output = O>,
sourceimpl<T: ?Sized + ToOwned, U: AsIs, O> BitXor<U> for Is<'_, T>where
    for<'a> T::Owned: BitXor<Owned<U>, Output = O> + BitXor<&'a Owned<U>, Output = O> + BitXor<&'a U::Is, Output = O>,
    for<'a> T: RefBitXor<Owned<U>, Output = O> + RefBitXor<&'a Owned<U>, Output = O> + RefBitXor<&'a U::Is, Output = O>,
 
impl<T: ?Sized + ToOwned, U: AsIs, O> BitXor<U> for Is<'_, T>where
    for<'a> T::Owned: BitXor<Owned<U>, Output = O> + BitXor<&'a Owned<U>, Output = O> + BitXor<&'a U::Is, Output = O>,
    for<'a> T: RefBitXor<Owned<U>, Output = O> + RefBitXor<&'a Owned<U>, Output = O> + RefBitXor<&'a U::Is, Output = O>,
sourceimpl<T: ?Sized + ToOwned, U: AsIs, O> Div<U> for Is<'_, T>where
    for<'a> T::Owned: Div<Owned<U>, Output = O> + Div<&'a Owned<U>, Output = O> + Div<&'a U::Is, Output = O>,
    for<'a> T: RefDiv<Owned<U>, Output = O> + RefDiv<&'a Owned<U>, Output = O> + RefDiv<&'a U::Is, Output = O>,
 
impl<T: ?Sized + ToOwned, U: AsIs, O> Div<U> for Is<'_, T>where
    for<'a> T::Owned: Div<Owned<U>, Output = O> + Div<&'a Owned<U>, Output = O> + Div<&'a U::Is, Output = O>,
    for<'a> T: RefDiv<Owned<U>, Output = O> + RefDiv<&'a Owned<U>, Output = O> + RefDiv<&'a U::Is, Output = O>,
sourceimpl<T: ?Sized + ToOwned, U: AsIs, O> Mul<U> for Is<'_, T>where
    for<'a> T::Owned: Mul<Owned<U>, Output = O> + Mul<&'a Owned<U>, Output = O> + Mul<&'a U::Is, Output = O>,
    for<'a> T: RefMul<Owned<U>, Output = O> + RefMul<&'a Owned<U>, Output = O> + RefMul<&'a U::Is, Output = O>,
 
impl<T: ?Sized + ToOwned, U: AsIs, O> Mul<U> for Is<'_, T>where
    for<'a> T::Owned: Mul<Owned<U>, Output = O> + Mul<&'a Owned<U>, Output = O> + Mul<&'a U::Is, Output = O>,
    for<'a> T: RefMul<Owned<U>, Output = O> + RefMul<&'a Owned<U>, Output = O> + RefMul<&'a U::Is, Output = O>,
sourceimpl<T: ?Sized + ToOwned, O> Neg for Is<'_, T>where
    T::Owned: Neg<Output = O>,
    T: RefNeg<Output = O>,
 
impl<T: ?Sized + ToOwned, O> Neg for Is<'_, T>where
    T::Owned: Neg<Output = O>,
    T: RefNeg<Output = O>,
sourceimpl<T: ?Sized + ToOwned, O> Not for Is<'_, T>where
    T::Owned: Not<Output = O>,
    T: RefNot<Output = O>,
 
impl<T: ?Sized + ToOwned, O> Not for Is<'_, T>where
    T::Owned: Not<Output = O>,
    T: RefNot<Output = O>,
sourceimpl<T: ?Sized + ToOwned> Ord for Is<'_, T>where
    T: Ord,
 
impl<T: ?Sized + ToOwned> Ord for Is<'_, T>where
    T: Ord,
1.21.0 · sourceconst fn max(self, other: Self) -> Self
 
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
 
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
    Self: PartialOrd<Self>,
 
const fn clamp(self, min: Self, max: Self) -> Selfwhere
    Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialEq<Is<'_, U>> for Is<'_, T>where
    T: PartialEq<U>,
 
impl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialEq<Is<'_, U>> for Is<'_, T>where
    T: PartialEq<U>,
sourceimpl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialEq<Is<'_, U>> for IsCow<'_, T>where
    T: PartialEq<U>,
 
impl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialEq<Is<'_, U>> for IsCow<'_, T>where
    T: PartialEq<U>,
sourceimpl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialEq<Is<'_, U>> for IsMut<'_, T>where
    T: PartialEq<U>,
 
impl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialEq<Is<'_, U>> for IsMut<'_, T>where
    T: PartialEq<U>,
sourceimpl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialEq<IsCow<'_, U>> for Is<'_, T>where
    T: PartialEq<U>,
 
impl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialEq<IsCow<'_, U>> for Is<'_, T>where
    T: PartialEq<U>,
sourceimpl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialEq<IsMut<'_, U>> for Is<'_, T>where
    T: PartialEq<U>,
 
impl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialEq<IsMut<'_, U>> for Is<'_, T>where
    T: PartialEq<U>,
sourceimpl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialOrd<Is<'_, U>> for Is<'_, T>where
    T: PartialOrd<U>,
 
impl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialOrd<Is<'_, U>> for Is<'_, T>where
    T: PartialOrd<U>,
sourcefn partial_cmp(&self, other: &Is<'_, U>) -> Option<Ordering>
 
fn partial_cmp(&self, other: &Is<'_, U>) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
 
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for 
self and other) and is used by the <=
operator. Read moresourceimpl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialOrd<Is<'_, U>> for IsCow<'_, T>where
    T: PartialOrd<U>,
 
impl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialOrd<Is<'_, U>> for IsCow<'_, T>where
    T: PartialOrd<U>,
sourcefn partial_cmp(&self, other: &Is<'_, U>) -> Option<Ordering>
 
fn partial_cmp(&self, other: &Is<'_, U>) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
 
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for 
self and other) and is used by the <=
operator. Read moresourceimpl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialOrd<Is<'_, U>> for IsMut<'_, T>where
    T: PartialOrd<U>,
 
impl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialOrd<Is<'_, U>> for IsMut<'_, T>where
    T: PartialOrd<U>,
sourcefn partial_cmp(&self, other: &Is<'_, U>) -> Option<Ordering>
 
fn partial_cmp(&self, other: &Is<'_, U>) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
 
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for 
self and other) and is used by the <=
operator. Read moresourceimpl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialOrd<IsCow<'_, U>> for Is<'_, T>where
    T: PartialOrd<U>,
 
impl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialOrd<IsCow<'_, U>> for Is<'_, T>where
    T: PartialOrd<U>,
sourcefn partial_cmp(&self, other: &IsCow<'_, U>) -> Option<Ordering>
 
fn partial_cmp(&self, other: &IsCow<'_, U>) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
 
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for 
self and other) and is used by the <=
operator. Read moresourceimpl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialOrd<IsMut<'_, U>> for Is<'_, T>where
    T: PartialOrd<U>,
 
impl<T: ?Sized + ToOwned, U: ?Sized + ToOwned> PartialOrd<IsMut<'_, U>> for Is<'_, T>where
    T: PartialOrd<U>,
sourcefn partial_cmp(&self, other: &IsMut<'_, U>) -> Option<Ordering>
 
fn partial_cmp(&self, other: &IsMut<'_, U>) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
 
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for 
self and other) and is used by the <=
operator. Read moresourceimpl<T: ?Sized + ToOwned, U: AsIs, O> Rem<U> for Is<'_, T>where
    for<'a> T::Owned: Rem<Owned<U>, Output = O> + Rem<&'a Owned<U>, Output = O> + Rem<&'a U::Is, Output = O>,
    for<'a> T: RefRem<Owned<U>, Output = O> + RefRem<&'a Owned<U>, Output = O> + RefRem<&'a U::Is, Output = O>,
 
impl<T: ?Sized + ToOwned, U: AsIs, O> Rem<U> for Is<'_, T>where
    for<'a> T::Owned: Rem<Owned<U>, Output = O> + Rem<&'a Owned<U>, Output = O> + Rem<&'a U::Is, Output = O>,
    for<'a> T: RefRem<Owned<U>, Output = O> + RefRem<&'a Owned<U>, Output = O> + RefRem<&'a U::Is, Output = O>,
sourceimpl<T: ?Sized + ToOwned, U: AsIs, O> Shl<U> for Is<'_, T>where
    for<'a> T::Owned: Shl<Owned<U>, Output = O> + Shl<&'a Owned<U>, Output = O> + Shl<&'a U::Is, Output = O>,
    for<'a> T: RefShl<Owned<U>, Output = O> + RefShl<&'a Owned<U>, Output = O> + RefShl<&'a U::Is, Output = O>,
 
impl<T: ?Sized + ToOwned, U: AsIs, O> Shl<U> for Is<'_, T>where
    for<'a> T::Owned: Shl<Owned<U>, Output = O> + Shl<&'a Owned<U>, Output = O> + Shl<&'a U::Is, Output = O>,
    for<'a> T: RefShl<Owned<U>, Output = O> + RefShl<&'a Owned<U>, Output = O> + RefShl<&'a U::Is, Output = O>,
sourceimpl<T: ?Sized + ToOwned, U: AsIs, O> Shr<U> for Is<'_, T>where
    for<'a> T::Owned: Shr<Owned<U>, Output = O> + Shr<&'a Owned<U>, Output = O> + Shr<&'a U::Is, Output = O>,
    for<'a> T: RefShr<Owned<U>, Output = O> + RefShr<&'a Owned<U>, Output = O> + RefShr<&'a U::Is, Output = O>,
 
impl<T: ?Sized + ToOwned, U: AsIs, O> Shr<U> for Is<'_, T>where
    for<'a> T::Owned: Shr<Owned<U>, Output = O> + Shr<&'a Owned<U>, Output = O> + Shr<&'a U::Is, Output = O>,
    for<'a> T: RefShr<Owned<U>, Output = O> + RefShr<&'a Owned<U>, Output = O> + RefShr<&'a U::Is, Output = O>,
sourceimpl<T: ?Sized + ToOwned, U: AsIs, O> Sub<U> for Is<'_, T>where
    for<'a> T::Owned: Sub<Owned<U>, Output = O> + Sub<&'a Owned<U>, Output = O> + Sub<&'a U::Is, Output = O>,
    for<'a> T: RefSub<Owned<U>, Output = O> + RefSub<&'a Owned<U>, Output = O> + RefSub<&'a U::Is, Output = O>,
 
impl<T: ?Sized + ToOwned, U: AsIs, O> Sub<U> for Is<'_, T>where
    for<'a> T::Owned: Sub<Owned<U>, Output = O> + Sub<&'a Owned<U>, Output = O> + Sub<&'a U::Is, Output = O>,
    for<'a> T: RefSub<Owned<U>, Output = O> + RefSub<&'a Owned<U>, Output = O> + RefSub<&'a U::Is, Output = O>,
impl<T: ?Sized + ToOwned> Eq for Is<'_, T>where
    T: Eq,
Auto Trait Implementations
impl<'a, T: ?Sized> RefUnwindSafe for Is<'a, T>where
    T: RefUnwindSafe,
    <T as ToOwned>::Owned: RefUnwindSafe,
impl<'a, T: ?Sized> Send for Is<'a, T>where
    T: Send + Sync,
    <T as ToOwned>::Owned: Send,
impl<'a, T: ?Sized> Sync for Is<'a, T>where
    T: Sync,
    <T as ToOwned>::Owned: Sync,
impl<'a, T: ?Sized> Unpin for Is<'a, T>where
    <T as ToOwned>::Owned: Unpin,
impl<'a, T> !UnwindSafe for Is<'a, T>
Blanket Implementations
sourceimpl<T, U, O> AddIs<U> for Twhere
    U: AsIs,
    T: for<'a> Add<<<U as AsIs>::Is as ToOwned>::Owned, Output = O, Output = O, Output = O> + for<'a> Add<&'a <<U as AsIs>::Is as ToOwned>::Owned> + for<'a> Add<&'a <U as AsIs>::Is>,
 
impl<T, U, O> AddIs<U> for Twhere
    U: AsIs,
    T: for<'a> Add<<<U as AsIs>::Is as ToOwned>::Owned, Output = O, Output = O, Output = O> + for<'a> Add<&'a <<U as AsIs>::Is as ToOwned>::Owned> + for<'a> Add<&'a <U as AsIs>::Is>,
sourceimpl<T, U, O> BitAndIs<U> for Twhere
    U: AsIs,
    T: for<'a> BitAnd<<<U as AsIs>::Is as ToOwned>::Owned, Output = O, Output = O, Output = O> + for<'a> BitAnd<&'a <<U as AsIs>::Is as ToOwned>::Owned> + for<'a> BitAnd<&'a <U as AsIs>::Is>,
 
impl<T, U, O> BitAndIs<U> for Twhere
    U: AsIs,
    T: for<'a> BitAnd<<<U as AsIs>::Is as ToOwned>::Owned, Output = O, Output = O, Output = O> + for<'a> BitAnd<&'a <<U as AsIs>::Is as ToOwned>::Owned> + for<'a> BitAnd<&'a <U as AsIs>::Is>,
sourceimpl<T, U, O> BitOrIs<U> for Twhere
    U: AsIs,
    T: for<'a> BitOr<<<U as AsIs>::Is as ToOwned>::Owned, Output = O, Output = O, Output = O> + for<'a> BitOr<&'a <<U as AsIs>::Is as ToOwned>::Owned> + for<'a> BitOr<&'a <U as AsIs>::Is>,
 
impl<T, U, O> BitOrIs<U> for Twhere
    U: AsIs,
    T: for<'a> BitOr<<<U as AsIs>::Is as ToOwned>::Owned, Output = O, Output = O, Output = O> + for<'a> BitOr<&'a <<U as AsIs>::Is as ToOwned>::Owned> + for<'a> BitOr<&'a <U as AsIs>::Is>,
sourceimpl<T, U, O> BitXorIs<U> for Twhere
    U: AsIs,
    T: for<'a> BitXor<<<U as AsIs>::Is as ToOwned>::Owned, Output = O, Output = O, Output = O> + for<'a> BitXor<&'a <<U as AsIs>::Is as ToOwned>::Owned> + for<'a> BitXor<&'a <U as AsIs>::Is>,
 
impl<T, U, O> BitXorIs<U> for Twhere
    U: AsIs,
    T: for<'a> BitXor<<<U as AsIs>::Is as ToOwned>::Owned, Output = O, Output = O, Output = O> + for<'a> BitXor<&'a <<U as AsIs>::Is as ToOwned>::Owned> + for<'a> BitXor<&'a <U as AsIs>::Is>,
sourceimpl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more