[−][src]Enum mown::Mown
Container for borrowed or owned value.
Variants
Owned value.
Borrowed(&'a T)
Borrowed value.
Methods
impl<'a, T> Mown<'a, T>
[src]
pub fn is_owned(&self) -> bool
[src]
Checks if the value is owned.
pub fn is_borrowed(&self) -> bool
[src]
Checks if the value is borrowed.
pub fn as_mut(&mut self) -> Option<&mut T>
[src]
Returns the owned value as a mutable reference, if any.
If the value is borrowed, returns None
.
Trait Implementations
impl<'a, T> AsRef<T> for Mown<'a, T>
[src]
impl<'a, T: Debug> Debug for Mown<'a, T>
[src]
impl<'a, T> Deref for Mown<'a, T>
[src]
impl<'a, T: Display> Display for Mown<'a, T>
[src]
impl<'a, T: Eq> Eq for Mown<'a, T>
[src]
impl<'a, T: Hash> Hash for Mown<'a, T>
[src]
fn hash<H: Hasher>(&self, hasher: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a, T: Ord> Ord for Mown<'a, T>
[src]
fn cmp(&self, other: &Mown<'a, T>) -> 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<'a, T: PartialEq> PartialEq<Mown<'a, T>> for Mown<'a, T>
[src]
fn eq(&self, other: &Mown<'a, T>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, T: PartialOrd> PartialOrd<Mown<'a, T>> for Mown<'a, T>
[src]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Mown<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for Mown<'a, T> where
T: Send + Sync,
T: Send + Sync,
impl<'a, T> Sync for Mown<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for Mown<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> UnwindSafe for Mown<'a, T> where
T: RefUnwindSafe + UnwindSafe,
T: RefUnwindSafe + UnwindSafe,
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> 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>,