[−][src]Enum into_owned::Is
Represents an owned value, an immutably borrowed reference, or a mutably borrowed reference.
Is<'a, T>
is similar to Cow<'a, B>
.
Unlike Cow<'a, B>
, it can hold a mutably borrowed reference.
This enum can be created by the as_is
method on IntoOwned
.
This enum, as a clone-on-write smart pointer, is highly experimental. Most parts are subject to change. Especially, more traits (e.g. from core::ops) will be implemented.
Variants
Borrowed(&'a T)
MutBorrowed(&'a mut T)
Implementations
impl<'_, T> Is<'_, T> where
T: Owned,
[src]
T: Owned,
Trait Implementations
impl<'_, T, U> AsRef<U> for Is<'_, T> where
T: Owned + AsRef<U>,
U: ?Sized,
[src]
T: Owned + AsRef<U>,
U: ?Sized,
impl<'_, T> Binary for Is<'_, T> where
T: Owned + Binary,
[src]
T: Owned + Binary,
impl<'_, T> Borrow<T> for Is<'_, T> where
T: Owned,
[src]
T: Owned,
impl<'_, T> Clone for Is<'_, T> where
T: Owned + Clone,
[src]
T: Owned + Clone,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
[src]
impl<'a, T: Debug> Debug for Is<'a, T> where
T: Owned,
[src]
T: Owned,
impl<'_, T> Default for Is<'_, T> where
T: Owned + Default,
[src]
T: Owned + Default,
impl<'_, T> Deref for Is<'_, T> where
T: Owned,
[src]
T: Owned,
impl<'_, T> Display for Is<'_, T> where
T: Owned + Display,
[src]
T: Owned + Display,
impl<'_, T> Eq for Is<'_, T> where
T: Owned + Eq,
[src]
T: Owned + Eq,
impl<'_, T> Hash for Is<'_, T> where
T: Owned + Hash,
[src]
T: Owned + Hash,
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'_, T> IntoOwned for Is<'_, T> where
T: Owned,
[src]
T: Owned,
type Owned = T
The owned type associated with Self
.
fn as_is<'a>(self) -> Is<'a, Self::Owned> where
Self: 'a,
[src]
Self: 'a,
fn into_owned(self) -> Self::Owned where
Self::Owned: Clone,
[src]
Self::Owned: Clone,
fn into_gyu<'a>(self) -> Gyu<'a, Self::Owned> where
Self: 'a,
[src]
Self: 'a,
fn try_into_gyu_mut<'a>(self) -> Option<GyuMut<'a, Self::Owned>> where
Self: 'a,
[src]
Self: 'a,
fn to_gyu_mut<'a>(self) -> GyuMut<'a, Self::Owned> where
Self: 'a,
Self::Owned: Clone,
[src]
Self: 'a,
Self::Owned: Clone,
fn into_cow<'a, B: ?Sized>(self) -> Cow<'a, B> where
Self: 'a,
Self::Owned: Borrow<B>,
B: ToOwned<Owned = Self::Owned>,
[src]
Self: 'a,
Self::Owned: Borrow<B>,
B: ToOwned<Owned = Self::Owned>,
impl<'_, T> LowerExp for Is<'_, T> where
T: Owned + LowerExp,
[src]
T: Owned + LowerExp,
impl<'_, T> LowerHex for Is<'_, T> where
T: Owned + LowerHex,
[src]
T: Owned + LowerHex,
impl<'_, T> Octal for Is<'_, T> where
T: Owned + Octal,
[src]
T: Owned + Octal,
impl<'_, T> Ord for Is<'_, T> where
T: Owned + Ord,
[src]
T: Owned + Ord,
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'_, '_, T, U> PartialEq<Is<'_, U>> for Is<'_, T> where
T: Owned + PartialEq<U>,
U: Owned,
[src]
T: Owned + PartialEq<U>,
U: Owned,
impl<'_, '_, T, U> PartialOrd<Is<'_, U>> for Is<'_, T> where
T: Owned + PartialOrd<U>,
U: Owned,
[src]
T: Owned + PartialOrd<U>,
U: Owned,
fn partial_cmp(&self, other: &Is<U>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, T> UpperExp for Is<'_, T> where
T: Owned + UpperExp,
[src]
T: Owned + UpperExp,
impl<'_, T> UpperHex for Is<'_, T> where
T: Owned + UpperHex,
[src]
T: Owned + UpperHex,
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Is<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for Is<'a, T> where
T: Send + Sync,
T: Send + Sync,
impl<'a, T> Sync for Is<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for Is<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> !UnwindSafe for Is<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,