pub enum ManagedValue<T> {
Owned(Managed<T>),
Ref(ManagedRef<T>),
RefMut(ManagedRefMut<T>),
Lazy(ManagedLazy<T>),
}
Variants§
Implementations§
Source§impl<T> ManagedValue<T>
impl<T> ManagedValue<T>
pub fn as_owned(&self) -> Option<&Managed<T>>
pub fn as_mut_owned(&mut self) -> Option<&mut Managed<T>>
pub fn as_ref(&self) -> Option<&ManagedRef<T>>
pub fn as_mut_ref(&mut self) -> Option<&mut ManagedRef<T>>
pub fn as_ref_mut(&self) -> Option<&ManagedRefMut<T>>
pub fn as_mut_ref_mut(&mut self) -> Option<&mut ManagedRefMut<T>>
pub fn as_lazy(&self) -> Option<&ManagedLazy<T>>
pub fn as_mut_lazy(&mut self) -> Option<&mut ManagedLazy<T>>
pub fn read(&self) -> Option<ValueReadAccess<'_, T>>
pub fn write(&mut self) -> Option<ValueWriteAccess<'_, T>>
pub fn borrow(&self) -> Option<ManagedRef<T>>
pub fn borrow_mut(&mut self) -> Option<ManagedRefMut<T>>
pub fn lazy(&mut self) -> Option<ManagedLazy<T>>
Trait Implementations§
Source§impl<T> From<Managed<T>> for ManagedValue<T>
impl<T> From<Managed<T>> for ManagedValue<T>
Source§impl<T> From<ManagedLazy<T>> for ManagedValue<T>
impl<T> From<ManagedLazy<T>> for ManagedValue<T>
Source§fn from(value: ManagedLazy<T>) -> Self
fn from(value: ManagedLazy<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<ManagedRef<T>> for ManagedValue<T>
impl<T> From<ManagedRef<T>> for ManagedValue<T>
Source§fn from(value: ManagedRef<T>) -> Self
fn from(value: ManagedRef<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<ManagedRefMut<T>> for ManagedValue<T>
impl<T> From<ManagedRefMut<T>> for ManagedValue<T>
Source§fn from(value: ManagedRefMut<T>) -> Self
fn from(value: ManagedRefMut<T>) -> Self
Converts to this type from the input type.
Source§impl<T> TryFrom<ManagedValue<T>> for Managed<T>
impl<T> TryFrom<ManagedValue<T>> for Managed<T>
Source§impl<T> TryFrom<ManagedValue<T>> for ManagedLazy<T>
impl<T> TryFrom<ManagedValue<T>> for ManagedLazy<T>
Source§impl<T> TryFrom<ManagedValue<T>> for ManagedRef<T>
impl<T> TryFrom<ManagedValue<T>> for ManagedRef<T>
Source§impl<T> TryFrom<ManagedValue<T>> for ManagedRefMut<T>
impl<T> TryFrom<ManagedValue<T>> for ManagedRefMut<T>
Auto Trait Implementations§
impl<T> Freeze for ManagedValue<T>where
T: Freeze,
impl<T> RefUnwindSafe for ManagedValue<T>where
T: RefUnwindSafe,
impl<T> Send for ManagedValue<T>where
T: Send,
impl<T> Sync for ManagedValue<T>where
T: Sync,
impl<T> Unpin for ManagedValue<T>where
T: Unpin,
impl<T> UnwindSafe for ManagedValue<T>where
T: UnwindSafe + RefUnwindSafe,
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